- F$ u I, @; g) W- ?: q! K! T本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。8 O* C- `" w( G- K2 l
There are four basic types of plots that you can create with the SGPLOT procedure: " C! M( e% x5 l! N8 nBasic plots1 P7 b& U2 f7 [3 k* t/ E
scatter, series, step, band, needle, and vector plots) z& l: d& W$ g4 z0 H s, C
Fit and confidence plots + A" X( @3 ^, `3 v" a6 c- C- S' Ploess, regression, and penalized B-spline curves, and ellipses7 v h( H9 W- ]0 J
Distribution plots ) R. N6 J. r7 Lbox plots, histograms, and normal and kernel density estimates7 g! v+ U. e) t0 R' A8 G3 d5 o
Categorization plots / X2 C$ ]+ n/ y. }" C7 Q; Vdot plots, bar charts, and line plots: d/ Z" d- F2 \, _
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$ T: V' d; {" V/ H/ t$ Z8 ?* n1 g
; Q- x* f' B! P7 E/ @8 b1 v& n, C4 t# R: t! T* h9 S
data ex;6 `7 V; o) V" y5 n
input x y ;; \3 a1 g n0 q, Q
cards; n5 O& T0 P# {: V3 ^$ S1 2 6 \/ ^- m, @) `/ A6 J# ?; U2 7% U: @1 ?. d& h. t
4 12& K$ k, p: a7 n i" Q! P0 p
5 11 2 w+ k+ J+ c5 n: A6 90 G( ^! Q7 E2 x/ d5 [
7 8 6 K( e6 F* d6 x% z* B; 2 `* z6 J+ P9 Q7 I# ttitle ;' \* @6 @" W6 u J6 A6 l
footnote; . |2 Q4 a+ K1 Z% |! A7 oproc sgplot data=ex noautolegend;5 t; Z) c5 _* Y! h) I4 X6 Z" d
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;: a, c! W$ K7 \' y
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; j8 E1 O0 @" ^" |
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 0 K( ^: ~0 u6 Y% }. lband x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; * y. W! n% B/ `1 y# ], Fband x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; . i* |6 G9 L, G* p/ U# uband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;5 d; e, J+ Y# X6 R X
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint;) t7 T1 _# G" O; k/ e: U0 I
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;5 p5 f! ]# }* f& T
run;) T6 |# d) Z9 i7 t& G b
来源:数据挖掘学院