/ `# X, i" B% d& K. `. ^- `
本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。! J6 |* _7 s$ D P: u! m
There are four basic types of plots that you can create with the SGPLOT procedure:* x9 J. p" V- @: \' {
Basic plots , D7 h6 X' ]- w* u8 `; O6 g5 qscatter, series, step, band, needle, and vector plots2 S& l' C8 @* M, W1 N |5 w' N
Fit and confidence plots " i/ P' I( s9 t+ dloess, regression, and penalized B-spline curves, and ellipses; S6 a3 b7 U* X0 A' R7 d
Distribution plots b8 @$ _2 v p, e1 E; H
box plots, histograms, and normal and kernel density estimates$ a0 I; \7 R B5 q- }: L
Categorization plots( ?9 _' o6 q0 H9 G
dot plots, bar charts, and line plots) C# Q7 t" C$ Z& A: n, ?0 H# l
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 ) g1 a- V) Y9 r9 P4 r9 d6 w& U' \& c* F' J6 L, I0 `2 s: |" c
. l, Y9 A, m t% T: ?& P6 mdata ex;5 I& o; e5 I9 H& c8 U
input x y ; % e0 J# Y5 D) P8 H; R+ n* Hcards;1 k! {) X" @; y0 d7 `0 o
1 2 ( i0 i/ h$ x* _0 h- o6 h7 p: G2 7 3 [ N$ x9 _) [, C) j# J$ |+ Q4 12 . L- m' q; K8 a- w+ U* l3 j0 \" [/ l5 11' ^; C* p) i* s8 `4 A
6 9 5 A/ ?3 E' {# [& W% D7 8 p) k; m2 f. Y5 h' \- t;2 F0 \% D; z" D: A3 v: Q
title ; }+ y9 m8 }: \, b; f0 E9 }% D
footnote;3 k( `: U! R5 }& \2 v
proc sgplot data=ex noautolegend;; S5 Y6 R% [$ e8 V
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;1 o+ g% ` T4 N( ]7 f3 D. j0 x
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;9 P. Y' o- ^+ Y4 ?3 @" A- @
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;. ]8 ?& ~- I2 u' O
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; + t! q( U+ Q& c- k" N2 f9 Pband x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 6 f+ w: y' T1 B* M) yband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;2 r+ z8 e' i+ ^3 X2 a# m
yaxis values=(0 to 12 by 3) min=0 max=13 valueshint; ' I" U$ D5 v4 ^! i9 s% S2 w4 sxaxis values=(0 to 8 by 2) min=0 max=8 valueshint; ! D+ l" S( p5 \2 ~run;6 \6 f! W/ y. Y. c
来源:数据挖掘学院