( \2 }7 ~5 `6 n( n8 Y' |" }/ i1 b4 n2 [本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。! J) {4 J$ S9 K0 \; i, G+ T
There are four basic types of plots that you can create with the SGPLOT procedure: / r7 W; Q/ n% N" K5 _2 q( Q" jBasic plots 0 Z8 t$ F: E ^( a1 I# w. Hscatter, series, step, band, needle, and vector plots. j" W- F4 U* Y. \( m
Fit and confidence plots ' I* D) t$ ?# N, b9 Q: dloess, regression, and penalized B-spline curves, and ellipses $ P8 N O7 M' c0 M; ?Distribution plots- D; J" `" B6 e2 W( H; U
box plots, histograms, and normal and kernel density estimates9 h/ i* \, I, H( n9 p! o
Categorization plots+ ?& S, v1 F. l. K$ v
dot plots, bar charts, and line plots1 H9 R2 O7 z8 {( o8 y% |3 M
Not 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 9 q1 @6 N5 L- N- U6 t! X2 H3 J F% N1 a: @1 t" w- E$ ^" G3 Y* G
& [; M# k3 Z, c8 Odata ex; - B0 m8 P, K6 d6 _6 Y" i# e3 j6 Jinput x y ;; W) B! E. [, t+ F8 s2 N3 e
cards; 7 ^3 @7 |1 \5 I# u0 \1 2 , J3 n) C" f! e8 S2 74 Z$ v$ C( N+ s4 S' v
4 129 z f5 O4 t5 ]0 e* T1 Y
5 11# @ N) a3 I( Z H5 }% V* t# T/ A
6 9; ~8 }4 T% q& Y9 C4 K4 R1 @: p
7 8 3 B1 u% \. R4 R+ e6 |. G;- [1 d7 O% R2 H7 K( \/ w
title ; 8 U3 k S* ]- |) [+ a! ~footnote;; A9 m( L) j7 W6 Y
proc sgplot data=ex noautolegend; ' o" Q! A' a4 L% cSERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ; 1 w x2 N- S4 k$ q9 }0 Vband x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;5 T0 z' ^. [( ^9 m) ]; l% |9 M
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; # i& E( {( V' r5 T. ?& Eband x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;( @) H$ P2 _) ]# r4 C/ _9 {
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;: r( k% U1 F E
band x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; \' t3 m+ f4 eyaxis values=(0 to 12 by 3) min=0 max=13 valueshint; * e7 G6 V3 k; ?xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;5 z! k$ g3 ?8 b; H2 b
run;6 i1 _* d8 N6 i1 _7 o. t C2 ~
来源:数据挖掘学院