* c6 n7 S0 l8 I6 U
本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。 ' ?: R$ N! D X' E& Y& ^3 o3 g. l. lThere are four basic types of plots that you can create with the SGPLOT procedure: 5 [- L( M8 I- z; x! J7 ZBasic plots7 {- @% c- |4 p& t) |6 k/ j3 H5 ]$ g0 v
scatter, series, step, band, needle, and vector plots ; q- N! f/ p% w! YFit and confidence plots * P& d5 o6 K, ^% _loess, regression, and penalized B-spline curves, and ellipses 4 T M; _* F" Z! G4 d5 rDistribution plots ( I9 L- |, e0 K& h4 H5 e, c, gbox plots, histograms, and normal and kernel density estimates1 @1 |/ z) e5 F) a; ~* Q! B+ j
Categorization plots ( [, ~( c1 _3 l6 gdot plots, bar charts, and line plots 8 Z* g* G4 |) [/ r0 [" z" h. lNot 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 together1 S$ D m. y$ b5 e; Q. ^' P
+ v ^, c$ l! \9 l4 c& e3 j1 B5 ?- ~- P9 x+ R" S; I8 K( a
data ex;. L `% c. C4 [" j k; W3 [6 [
input x y ; , \: J) k9 J5 L6 N4 s5 {/ ~/ V# Ycards; 7 u4 I9 F3 H2 e0 z; a3 r1 22 X" T; j# G/ l
2 74 T4 l$ x( W3 D" }+ T
4 124 ^8 \& Z8 v' k/ x4 D% x" ~- N8 s
5 11 + o* ^! h6 y+ B4 a+ I6 9 7 b! W* d! s4 K9 Y' t# t7 8, \5 y ?3 X4 ?7 D0 y
;* O H4 e" I7 M a5 v3 n
title ;; p& f4 t" X( D7 N$ T2 o3 i! ^
footnote; ( o4 s1 _% Z3 a9 D: i" w9 @- Oproc sgplot data=ex noautolegend;" | ?8 g3 Y- ?# L+ L. N5 i+ l
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;- y2 \" T) y, `# s' J' q$ m
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;, D7 q; ]& ~) J& i( q1 z7 ]! n
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;. x* Y! r& j9 w( [6 E3 A
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;, t, l$ H2 z; S4 o8 E
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; * U: V: y7 I' T* X" w8 c% Xband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;% z2 l0 d9 q3 p& V# O7 Y& S
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint;2 {: O5 V1 u" `( b6 j
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;3 ~1 a( s( }: T/ |& T5 k6 g) G
run; % w- z9 K6 O8 X# m, T来源:数据挖掘学院