" [; B! n# r! B9 r/ t
本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。 3 q. W; B: A: X) Z: z* D5 uThere are four basic types of plots that you can create with the SGPLOT procedure:* `2 @! n. r6 R+ k* Q" A7 O+ K. G/ G
Basic plots 6 z: I; g! A& b2 vscatter, series, step, band, needle, and vector plots3 F5 Y. H( N2 D( O
Fit and confidence plots ' g+ Y& k5 _) c9 c" t1 |/ T' cloess, regression, and penalized B-spline curves, and ellipses- i5 G2 I$ p6 ^# M8 f
Distribution plots . q' L/ i& z9 P; @/ Qbox plots, histograms, and normal and kernel density estimates ; @4 {) M; c% p3 S* W l0 s1 _6 g" UCategorization plots . Y3 k5 c( k0 J7 Hdot plots, bar charts, and line plots 6 z: _, D4 l ]% \: W( |9 `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. {# N% m/ \: x* Y
* S+ j# Y$ I4 R+ X# M : i" X% u! n- V- _$ j9 G0 K2 X% d) Ydata ex;0 y% Y6 ]0 b, A& l6 d" \
input x y ; 0 W) u. a1 e; Xcards; ' L) r! V; `" y' n1 2: [$ u0 [8 H+ [* q- v# B" \
2 7: ^% K. C$ s* {( A5 f
4 12! b% F+ y2 x. R j: `! |; f
5 11 ( T' k# F1 Q+ k2 W' L- O6 9" o. g3 I) H! W
7 8 " v. [, [! K: i+ p4 H& e;1 Z. o+ J& K: z2 K4 y' a
title ; $ ?2 _& }6 @8 H& H5 |4 ?: o% Dfootnote;; e0 Q/ |/ r7 d( l
proc sgplot data=ex noautolegend;. C5 ]$ F5 S9 u
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ; ; p. J* v M1 L9 t8 O( |$ |( U0 Gband x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; $ ?1 ^% b% E( R) M- r" z) hband x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;+ T7 T4 O+ C* I0 ^$ G) q
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;, C6 J8 |0 [+ a$ c: _9 e
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; / j5 q+ F) r, ~( Y. a( Y6 jband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;* U" z6 ~% T% |0 u7 h
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint;& X( G9 Z: e# I* G3 c) P( ?6 v, T
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;5 g5 C" q( {) i+ P2 `+ T
run;* w# W$ } Q6 A+ H. \
来源:数据挖掘学院