+ ]5 B8 v8 u5 h* e7 [) E+ a本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。0 C& C! L, R/ r$ U
There are four basic types of plots that you can create with the SGPLOT procedure: 1 c f$ Y5 i5 `( l2 j& O" pBasic plots 1 F+ L$ u( Q1 A ]4 U1 }scatter, series, step, band, needle, and vector plots {# b; F+ `6 q0 R& [Fit and confidence plots ' z* h! `2 V! K7 G3 sloess, regression, and penalized B-spline curves, and ellipses / J, l8 g+ D* Y3 s) C' RDistribution plots 5 s5 t0 P( p% w: I' z9 }" h+ [, vbox plots, histograms, and normal and kernel density estimates 6 `/ a, _9 U* A; @Categorization plots . \& T W. ], A7 K, Y0 udot plots, bar charts, and line plots 7 h7 k$ l% A/ c7 a% tNot all of the plot types can be used together in the same PROC SGPLOT step. The following table shows which of the plot types can be used together/ M2 k4 m9 u& b! Z
3 M/ I- ~4 |; t( E$ X6 R
3 e, A7 j! ^" \5 ~7 l+ m X' B2 [data ex; h' m: z* K6 g! Y
input x y ; 4 r$ P& l6 R8 t% ?2 V8 o3 O# scards;2 G# }5 v4 y; L0 G w' `. Q) `! P
1 21 l8 o5 o p% l0 z$ c
2 7 5 g+ g& V, K: E+ m4 12 1 ]5 r/ ^" }4 o* ?# Q5 11- h/ N% x- Q5 o! N9 z" S
6 9 + D4 ~8 `3 W, S' w6 Q6 `7 8$ `1 t8 X9 i" s8 y- d% _! h. ?( B8 a, L
;8 E, f8 B! J' ^, G' w
title ;+ T$ D: ]1 D- `5 e D6 X
footnote; ! e9 a# H, B6 J5 x2 U2 [0 ?1 uproc sgplot data=ex noautolegend;1 {% M" D/ ?; Y* M
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;- d! z* Y. U T; q
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; 7 W# l: b0 s6 z3 `4 b; U9 N3 uband x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 8 c3 K6 H9 I% G3 M1 Kband x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; p! [5 K9 A5 j& X! p9 n
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; ( \, w" O D7 ?8 H6 R; o/ Q1 j7 [' b/ s; oband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; ' y! c3 n5 X' g/ ayaxis values=(0 to 12 by 3) min=0 max=13 valueshint;: y4 u8 ^0 n+ F2 L9 r
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;4 |3 F2 K8 b, Z( u @
run; . J: m+ t$ A2 }8 w( b来源:数据挖掘学院