" m8 U, K: H# R1 n2 m/ c本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。% F: X, s& H. M! j: |" j, C
There are four basic types of plots that you can create with the SGPLOT procedure:0 `- s5 c5 r& C4 x/ d- n3 ]
Basic plots9 H- u, J+ w/ `: e( n9 s+ n+ E4 Y6 U
scatter, series, step, band, needle, and vector plots3 v) ^6 u# Q( L& t
Fit and confidence plots: H- ]3 j s! z! Q2 O. z$ g9 z
loess, regression, and penalized B-spline curves, and ellipses ( p- O: J) y; d0 h) \2 w( \) LDistribution plots $ |8 i# }8 U3 q" Dbox plots, histograms, and normal and kernel density estimates ; Z7 j* D; R6 L! C# e7 mCategorization plots U" V( y- T5 u
dot plots, bar charts, and line plots # G8 r. R& i! X& gNot 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 together4 w! I$ u( F2 m: ?+ b! G
( J5 Z7 a; A) z9 \7 G2 b- G. s3 C- A$ l+ N E
data ex; ) ] }" r' Y9 V0 {5 {input x y ; " t5 L! [: u8 `" @& i* bcards;' T8 H+ m4 u( @: [- J) @: Q O
1 2/ ^8 D) _8 b! t& W, \
2 7& m9 B- i1 f6 w- ]1 ]: ? p) N3 E/ G
4 12" A l: W* d1 m( T# R
5 11 . j& z7 N$ u% i/ ^& c6 99 O5 f4 [" o1 r2 J E/ y3 `7 z6 I
7 85 K) u/ V3 u* }% ?1 f$ N- \, r
; ( v0 G" @; }' H& p$ F" S- ^- ctitle ;" W7 r2 S" e- o6 N% ?# }, f
footnote;# Q: m3 v2 Q. U" k, m% J' J' U! E& S
proc sgplot data=ex noautolegend; 9 O; W) K. e4 |0 USERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ; / W1 ^# u5 R. L) z. E0 dband x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;' q% Y( S8 l/ W/ I- h. G
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;3 X5 X+ R; G3 a3 d }; i0 i: \
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;$ ?3 V- m& a3 o3 x9 Z( X% b
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 2 h& B* }% U9 G. aband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;) \+ z8 T& O) w1 u$ b) D
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint; U7 {3 C) J: E9 l' c. Y( \) ^
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint; 6 {8 C% R( [$ L8 N6 S, grun; ! M9 F: ~& l3 \" |来源:数据挖掘学院