; ?* \. R) C! l8 P( g本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。9 H, M# b7 R3 K+ C1 u
There are four basic types of plots that you can create with the SGPLOT procedure: # F' N9 H1 Z( s0 X) TBasic plots 5 z" s$ Z6 N1 z% Vscatter, series, step, band, needle, and vector plots! U/ w" p5 K# t( y
Fit and confidence plots) e' s, K& m9 M* Y4 M, c
loess, regression, and penalized B-spline curves, and ellipses ) n+ P' D, Z7 u. f- CDistribution plots4 f9 I( Z6 t: _/ K; }) o
box plots, histograms, and normal and kernel density estimates0 `1 Y1 C" i1 `' ?- S* G( ]
Categorization plots 1 o5 z2 }2 [$ {3 tdot plots, bar charts, and line plots& e: m5 p- d% q
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. ], a! ]' y( i3 `" C- [8 c
8 E7 r( V0 q3 J$ M' X6 \
7 _+ |. O% M$ ]& b$ i, Pdata ex; 2 | T v; K; ^$ z5 `input x y ; / T) U3 A- u$ C) x# [) Bcards; 8 z. E$ m# J! n0 B7 `( T1 2 & H7 ^9 K3 c7 T c2 7/ d& q* A$ Z/ ?5 ~* q i
4 12 7 J( e" d) l2 _* ?% H4 u) E5 119 k* J7 ^( n: k/ X% i( ~' f
6 9 + X% H' I7 _1 J9 f+ F" Q7 8' x" M; W) ?- ]4 a! x
;" |* u2 y/ ~; }: v- s
title ;2 l$ r- l% [1 M: g# z
footnote; : Y0 w ?9 H9 \9 b# [. U, }proc sgplot data=ex noautolegend;: ~% }" p2 }9 \9 ^/ m( C \ v
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;! z4 O/ P9 M( i) G: @
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; ; C6 C6 A+ F9 E. h' _: Z2 \+ X; i3 j+ qband x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;4 p- s) A. Q" e5 v
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;! f/ j7 c$ l: J, m% o
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 1 Z- c D. I6 B' k9 A+ m6 Dband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; . f/ j3 }; l4 p( nyaxis values=(0 to 12 by 3) min=0 max=13 valueshint; * d3 v( @1 w" X0 I( [) Q8 e0 axaxis values=(0 to 8 by 2) min=0 max=8 valueshint;7 U& \2 b* }$ N9 H5 ?* k
run;/ A5 r% ?! N0 W5 U/ G8 E
来源:数据挖掘学院