Data visualization with SAS programming

Overlay with Y*X=Z graphs in proc gplot

Reply
Frequent Contributor
Frequent Contributor
Posts: 94

Overlay with Y*X=Z graphs in proc gplot

I want to combine the two graphs produced by this code:


proc gplot data=sd12;
plot ObTotal*SSequence=NumberOfDays /
haxis=axis1 vaxis=axis2;
plot DeTotal*SSequence='dot';
run;
quit;

I've tried using overlay to get them on one graph itself, but overlay doesn't work with y*x=z plots.

Any suggestions please? Thanks.
SAS Super FREQ
Posts: 888

Re: Overlay with Y*X=Z graphs in proc gplot

What version of SAS are you running?
Frequent Contributor
Frequent Contributor
Posts: 94

Re: Overlay with Y*X=Z graphs in proc gplot

9.1.
Valued Guide
Posts: 632

Re: Overlay with Y*X=Z graphs in proc gplot

Since both plots have a common horizontal axis the PLOT2 statement may be helpful. Here is an extremely attractive graph offered as an example.
[pre]symbol1 v=dot c=pink l=1 i=j;
symbol2 v=dot c=blue l=1 i=j;
symbol3 v=circle c=pink l=2 i=j;
symbol4 v=circle c=blue l=2 i=j;

proc sort data=sashelp.class out=class;
by age sex;
run;
proc gplot data=class;
plot height*age=sex;
plot2 weight*age=sex;
run;
[/pre]
Frequent Contributor
Frequent Contributor
Posts: 94

Re: Overlay with Y*X=Z graphs in proc gplot

Excellent result.
Many thanks, ArtC.
Ask a Question
Discussion stats
  • 4 replies
  • 642 views
  • 0 likes
  • 3 in conversation