[9 C1 _" L7 D2 Q: K本来准备在sgplot的band语句画区域作为背景来实现的,但是由于存在bar图与band不兼容的情况,于是只好转向anno了。见SAS公司详细说明。 / c% S# Z& K( @7 YThere are four basic types of plots that you can create with the SGPLOT procedure:+ `- q) ]* v7 E6 h, `/ E+ A
Basic plots e, Y& E$ c/ {& G% S; ^4 Y8 Tscatter, series, step, band, needle, and vector plots0 C$ ~' T% w9 J. N
Fit and confidence plots c$ k; N: G; r8 Q6 ?
loess, regression, and penalized B-spline curves, and ellipses L# I! n( R3 E/ @4 } l8 CDistribution plots 8 R/ m# @9 `1 d; a7 o" z- X" Dbox plots, histograms, and normal and kernel density estimates ' a H( R# j! OCategorization plots ' U% y0 [3 o& M* l+ o& Pdot plots, bar charts, and line plots ( j, |4 Z4 Y) a7 g. V' NNot 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" A3 G1 W, C/ G; O. m" T3 {
+ z% F8 a$ Y& C( [& d: N7 Z ) P2 T7 A1 ?, M2 I5 ~, K1 T* Adata ex;" E9 H/ b1 I! @( R; {) v) h7 d4 x
input x y ; ( l, D# n0 n5 ?) ?, D. scards; ; W3 b9 Z o1 s% z. n3 c1 2& w; r: T D3 i' M5 s9 T& \# C; A
2 7 ! l1 q! s. [* w/ R. H6 n4 12) d: K4 x! n8 y
5 11% S* ~& B/ j& D3 ~
6 9 % ]9 R- [8 Z5 H' U$ l( P1 q* B7 8 6 H* Z, e, b1 W2 T) F- L; s( l# T. M. y% V
title ; - r/ M/ S/ w9 [: Rfootnote;; U' t, u: S$ s z7 b9 a
proc sgplot data=ex noautolegend;( J3 I4 [) A; \1 C+ W* U! R
SERIES x=x y=y/LINEATTRS=(color=blue thickness=6) ; 2 O% ?! O" h( M1 q; e; qband x=x lower=0 upper=2.5 / OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; % O5 A" [9 d9 Y! Lband x=x lower=2.5 upper=5 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; # v' q1 x: `3 j9 X9 Sband x=x lower=5 upper=7.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; ' k' M% b5 y- t) @* K# C0 rband x=x lower=7.5 upper=10 / OUTLINE transparency=.7 LINEATTRS=(color=black) fillattrs=(color=orange) NOOUTLINE; 5 T4 N' R+ \ L( l- K. @: ~2 ]band x=x lower=10 upper=12.5 /OUTLINE transparency=.8 LINEATTRS=(color=black) fillattrs=(color=cxEEE3B4) NOOUTLINE; : O& M2 T# Y. I7 H8 xyaxis values=(0 to 12 by 3) min=0 max=13 valueshint;) v( W+ \/ n8 K# O$ U& L2 T
xaxis values=(0 to 8 by 2) min=0 max=8 valueshint;, }! }- |3 J# q5 F# h, W. t/ b
run;* x) P5 _- G$ F6 B& q) x$ y& N, k
来源:数据挖掘学院