" M5 R* M3 z/ M
本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。0 z, U+ |, G4 } N1 h: G
There are four basic types of plots that you can create with the SGPLOT procedure: " @$ p$ H- {" IBasic plots " P) G6 [( \6 ?- @7 {; D; x! cscatter, series, step, band, needle, and vector plots ( [% \; O6 S& l2 c {- ]Fit and confidence plots' s. b/ `, [8 n0 {( N1 b
loess, regression, and penalized B-spline curves, and ellipses1 Y% i, H6 G! ~% q+ D7 @* K o6 k
Distribution plots1 M. i1 Z6 |; G P! P6 ]
box plots, histograms, and normal and kernel density estimates 2 Q! c% F: M' W: y; k) [6 L7 lCategorization plots' B F, G; F* G i& Y! k$ e
dot plots, bar charts, and line plots 2 V7 t" z3 m: J9 JNot 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 S2 [4 R1 P& g. L3 l3 c
* u. U6 {/ B$ N. p4 g5 X( Q
' |8 ~6 ~# ~& Q/ U) idata ex; 0 f/ D' A# \$ Ninput x y ; / t/ r/ y ^! C6 x+ p8 e8 F- bcards; + D: P9 n0 X) v" H1 2 4 t' Y$ C! p; ]! ^2 |1 W1 X; p2 7! e2 Q+ w( Y4 U% x. S8 n
4 12 . z: l6 I) ?$ B" P+ v$ D: s/ O5 11# D* ?4 s6 y6 H! m( Y# q
6 9 + Y3 e! f: q( n1 m6 H. ^; v6 }7 87 G# s5 O3 x; ` ]
; * K. T8 U* N T' q4 @5 ?. l2 w# ~title ; ( \: A( H$ |, Y0 j# zfootnote; " e3 y+ O9 o( \& wproc sgplot data=ex noautolegend;1 Z+ H% o; X6 W. c5 a! z1 M
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ; k8 @4 L, t! a
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;* H2 Z- ?6 T. u
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;( m& W$ z* }( t* c
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; / r+ S# h( o8 ~+ k( `- p: @0 Wband x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 5 C2 x: E6 ^7 @$ L) f! @5 Jband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;' i4 W% q1 W' b) G& \
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint;/ b+ @. W6 j0 T9 u% ~) M
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint; ~2 K' a. G3 n
run; / x' W: D' C! ~/ I来源:数据挖掘学院