; |. g3 p+ z+ f0 L0 {
本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。0 A+ r0 R5 z: e& q# d$ ~
There are four basic types of plots that you can create with the SGPLOT procedure:( W0 m& ~- p5 M& L# F! h& A
Basic plots! B7 i9 J6 l" b# [) i m
scatter, series, step, band, needle, and vector plots M0 c" N3 X2 ?9 @1 w0 W" m0 Y/ ]* |Fit and confidence plots 3 [5 |% s$ i+ |: ~8 `+ M2 Hloess, regression, and penalized B-spline curves, and ellipses5 T5 Y! s, G. ^
Distribution plots / ^2 K9 r1 ]- g% H: |, O$ cbox plots, histograms, and normal and kernel density estimates , S5 r) y, Q2 kCategorization plots, L7 p; b5 A. w* ^
dot plots, bar charts, and line plots 9 N `$ s0 R9 [3 bNot 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 {4 {6 a# a1 h3 j0 m# Y7 t$ [ L; X7 _
' i7 p6 R' Z* B3 }5 B s# [# c9 kdata ex; b$ p$ k# g! R/ J' ]1 [
input x y ;4 `/ _; v. j% }" r& I# G. p
cards; / [+ y9 _7 Y, s1 i1 2 7 z9 R; \0 |' E2 7 3 u! B# K6 l% U4 12 3 k' V4 i& R5 q. s, F3 o+ y) Z6 a5 11 2 H9 j8 Y: `( j7 V$ `3 f6 99 n9 }+ d5 W0 y! Z6 Z* i8 ~
7 81 s3 _4 v; ?8 J" e- R
;; S+ e- O" s1 Y$ X
title ;5 K* j) A0 o3 {" m0 A7 o
footnote;) N% [% E, l; b% V) M$ Q
proc sgplot data=ex noautolegend; : O: z! k+ K/ W: E$ }SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ;8 `( O2 Z9 y9 J* i5 Z: a5 B
band x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE;$ |" n: O/ D9 b
band x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE;1 d9 x9 i$ I3 T% H0 S
band x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; v7 k3 v* I2 {+ d R( R; Oband x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; ) F5 f$ B0 @5 cband x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; * l$ k6 N, Q m4 J1 x C, v2 p% byaxis values=(0 to 12 by 3) min=0 max=13 valueshint;2 t- ?1 G2 g* X: U1 l" z' ]/ g E
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;# y9 a6 V( S" \3 z% j
run; v1 ~) s/ Y2 @7 i4 x: b1 _# n
来源:数据挖掘学院