3 Y( Z" `9 _1 g8 n( y3 e' d本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。" o+ s# l5 C& r3 ?& S
There are four basic types of plots that you can create with the SGPLOT procedure:7 J2 B7 a+ ?0 A' ~" u$ z5 Q! P0 H
Basic plots* U# q" s7 H# x) m8 u, N0 a* s3 A. z
scatter, series, step, band, needle, and vector plots - T3 k5 N, H! u! |" y m% D, DFit and confidence plots 5 C+ K5 p" z3 E9 V" D( X, L- A0 A( mloess, regression, and penalized B-spline curves, and ellipses8 s, B$ p8 C2 q- |/ P: z; f* ?
Distribution plots/ T, Q' p' c$ ? P, Q7 `, X
box plots, histograms, and normal and kernel density estimates 2 X+ s( z: X9 X) d3 e, aCategorization plots - J" V0 w; c4 l9 qdot plots, bar charts, and line plots & _9 y3 I* r: u/ H* I2 ENot 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 6 Y% y2 @$ \( @; {+ n3 P' j$ x1 z2 t2 @6 o5 E
% }2 C+ G. C; ?data ex;& T3 n& c7 u4 Z; M
input x y ; : b. ^) `% A) m% @8 Xcards;+ F2 J" q6 H% M' w( ^
1 2 $ b% L8 v. }* H' ]2 7 4 S; O: x' s: z4 f2 y; D* t4 12 + S5 I$ Y1 {: g, J/ ?- V$ C5 11 $ p3 n' S1 ~; t: {1 f6 9 # T4 C( H; g- a6 \! {7 86 C. M2 i1 K+ V
;0 L- L* Z W+ {4 E
title ;2 n" s/ Q/ j% m' V
footnote; $ N; O: o- r2 O& lproc sgplot data=ex noautolegend;2 `2 f7 f2 D" `; z% ?3 @5 ]
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ; / h% f9 k% |: L- e6 K s8 i# S2 ]1 D; S- Qband x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;. a; g0 U5 H3 F( E4 M
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;# j9 I8 J# o4 J8 _, L+ m. b
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; 0 t2 D) g8 s' b7 ~band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;8 Z; T; Z6 ~+ S! l9 n. A
band x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;- Y' \, h3 y/ m# w6 D4 [
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint; 5 s- f4 Y& a6 ^; I sxaxis values=(0 to 8 by 2) min=0 max=8 valueshint;8 V5 t) [% i3 |6 y5 D" [
run; $ T4 G) k& D7 F$ Z7 f来源:数据挖掘学院