goptions reset=all /* reset graph options to defaults */ lfactor=2 /* double thick lines */ ftext=oldeng /* note comments INSIDE a command */ htext=2; data one; input X Y Z @@; Xjitter = X + .001*ranuni(1827655); label Z="Very Long Z Label"; cards;; 1 1 5 1 2 8 1 3 12 2 1 4 2 2 7 2 3 18 3 1 6 3 2 12 3 3 27 2 2 5 2 2 12 2 2 10 ; title "Example " f=symbol "a" h=1.2 "1"; proc gplot; title2 "Graph 1"; plot Z*X; axis1 label = (angle = 90); axis2 label = (rotate =90 font=duplex); run; proc gplot; plot Z*X/vaxis=axis1; title2 "Graph 2"; goptions htext=2; * BEFORE run *; run; proc gplot data=one; title2 "Graph 3"; plot Z*X/vaxis=axis2; label Z="Short Z"; run; proc gplot data=one; title2 "Graph 4"; plot Z*X=Y/vaxis=axis3 nolegend; symbol1 v=dot i=join l=2; symbol2 v=square i=join l=3 w=3; symbol3 v=diamond i=join l=4; axis3 label = (angle=-90 rotate=90 font=centb height = 1 j=left); label Z="Short Z"; run; goptions reset=all; /* AFTER the run statement */ proc gplot; plot Z*X=Y; title2 "Graph 5"; symbol1 v=dot i=join l=2 c=red; symbol2 v=square i=join l=3 w=3 r=2; symbol3 v=diamond i=join l=4; run; proc g3d; scatter X*Y=Z; title2 "Graph 6"; goptions reset=all; run; proc g3d; title2 "Graph 7"; scatter Xjitter*Y=Z/shape="balloon" noneedle; title3 "Jitter X"; run; proc g3d; plot X*Y=Z; title2 "Graph 8"; data two; set one end=eof; output; if eof then do X=1 to 3 by .1; do Y = .95 to 3.05 by .1; Z=.; output; end; end; proc reg noprint; model Z=X Y; output out=three p=p; data insight; set three; Zplus=P; cval="green"; sval="balloon"; if Z ne . then do; Zplus=Z; cval="black"; sval="prism"; end; ** Go into INSIGHT and plot Zplus vs (X,Y) **; proc g3d; plot X*Y=P; title2 "Graph 9"; run; proc g3d; title2 "Graph 10"; plot X*Y=P/rotate = 2 tilt=2; where Z=. ; run; proc g3d; title2 "Graph 11"; plot X*Y=P/rotate = 2 tilt=85; where z=.; run; proc g3d; title2 "Graph 12"; scatter X*Y=Zplus/color=cval shape=sval noneedle size=.5; run; ******** The ANNOTATE facility **************; Data anno1; xsys = '2'; ysys='2'; zsys='2'; *** 2 says to use the graph coordinates rather than CM or IN or CELLS ***; function="label"; X=2; input text $ 1-5 Y ; *23456789 12345679; cards; Y=1 3.5 Note: ANNOTATE uses Y for vertical axis Y=2 8.3 even if vertical represents, say Z as is Y=3 20 does here. Does data step read this ??? ; proc gplot data=one annotate=anno1; title2 "Graph 12"; plot Z*X=Y; run; data anno2 ; length position $ 1; xsys = '2'; ysys='2'; zsys='2'; do Y = 1 to 3; do X=1 to 3; input position $ @@; XX=2; YY=2; function = "Label"; size=2;text=position; output; end; end; cards; 7 8 9 4 5 6 1 2 3 ; proc print; proc gplot data=anno2 annotate=anno2; title2 "Graph 13"; plot X*Y/haxis=0 to 4 vaxis= 0 to 4; symbol1 v=dot i=none; plot xx*yy; run; %let z = z=4+5*x+3*sin(3*Y) + 2*cos(5*X); data anno3; xsys = '2'; ysys='2'; zsys='2'; do x = 1 to 3 by .1; Y=1; &Z; function="move"; output; do Y=1 to 3 by .1; &Z ; function="Draw"; output; end; end; do y = 1 to 3 by .1; X=1; &Z; function="move"; output; do X=1 to 3 by .1; &Z ; function="Draw"; output; end; end; proc g3d data=one annotate=anno3; title "Graph 14"; scatter X*Y=Z; title3 "&z"; run; quit;