Data visualization with SAS programming

By statement in the proc gplot - multiple plots on the same graphs

Reply
Occasional Contributor
Posts: 12

By statement in the proc gplot - multiple plots on the same graphs

proc gplot data=dd;

  by vv;

  plot x*y;

run;

i have the above proc and i want to generate the all plots on the same graph (one graph) with different colors, any idea or statement ?

Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: By statement in the proc gplot - multiple plots on the same graphs

Hi,

If you are using SAS 9.x your probably better off investigating proc sgplot or gtl.  The gplot is quite old.  This is an excellent blog which gives 9.3/9.4 sgplot and gtl examples for pretty much everything you will need:

http://blogs.sas.com/content/graphicallyspeaking/

SAS Super FREQ
Posts: 620

Re: By statement in the proc gplot - multiple plots on the same graphs

With both GPLOT and SGPLOT you can group your data, see sample below:

proc gplot data=sashelp.class;
  plot age*height = sex ;
run;
quit;

proc sgplot data=sashelp.class;
  series x=age y=height / group=sex ;
run;
Post a Question
Discussion Stats
  • 2 replies
  • 279 views
  • 0 likes
  • 3 in conversation