# a# A+ G1 _) y" L本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。; r) X- k0 [9 X( e+ k2 e& S1 j( U9 p1 K
There are four basic types of plots that you can create with the SGPLOT procedure: 6 H; t" ~2 Y h% x* vBasic plots( v6 k O3 ?2 T6 Z/ v; K! |, \0 m
scatter, series, step, band, needle, and vector plots ( L3 o v% z9 P, G( V. ?+ Y9 ]' oFit and confidence plots 6 z$ l x) p" r- m( @. w( Sloess, regression, and penalized B-spline curves, and ellipses" V W" m7 w; b* }9 O8 q6 `
Distribution plots3 ~( g7 m& [, Z& p) L( s
box plots, histograms, and normal and kernel density estimates* M' W0 `2 P' M
Categorization plots ( l* k4 f, C! x$ b" a! vdot plots, bar charts, and line plots2 |3 P5 \6 L* c7 B
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 1 e8 {3 M4 L; c5 Y, k5 U4 } @$ U$ g0 R& B- ]
) u3 X8 R) ^ z' E
data ex;1 r9 _3 V7 A/ t
input x y ;1 M A) F2 D) L3 j( ~
cards;( g' V1 W$ J6 U8 {7 t
1 2 ; ^4 ^: @. A, [$ J" |7 |) N2 7 ) C+ u7 j' \$ V3 j# ]4 12' V: |: ?! I/ a) r0 U
5 11) w# L+ r2 @9 `1 W) [
6 97 p; ?/ K& S7 L+ A( Q- I* Z
7 85 l. q% ^6 D0 w- q" d
; P) J; c+ l& d& l! P
title ;0 u6 F( \1 }, Q
footnote; , `* b3 Z2 k0 lproc sgplot data=ex noautolegend;& Q. }2 T) X1 ?/ h B( |, X* s
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;& W0 V/ o! v8 |/ p3 H
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;7 J$ R8 a, P$ N( h
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;& S' t1 Y8 E5 l8 c* j+ q! Q G
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;0 ~0 ^( \, o* U* ^% P8 T
band x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; # E: x- U& J. P6 z! I( H7 Y b4 H2 fband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; ( K' C) m& u) x, z+ G9 dyaxis values=(0 to 12 by 3) min=0 max=13 valueshint;' s0 ?! u; t* h! D9 u, q: \# ^+ R
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint; ( V* }, ]# M& f' R" y1 grun; : k( r- @) d% ?来源:数据挖掘学院