Data visualization with SAS programming

Gplot with two different data sets: How to put into one chart

Reply
N/A
Posts: 0

Gplot with two different data sets: How to put into one chart

/** first one has a few hundreds of obs. and a trend chart **/
goptions reset=global
gsfmode=replace
gunit=pct border cback=white ftext=swissb htitle=6 htext=3
colors=(blue green red);
symbol2 value=star color=green;
symbol1 color=red;
proc format;
value test 1 ='Meet'
0 ='Does not Meet';
run;
proc gplot data=safe;
plot J*K=z /hm=5;
format z test.;

/*** the second one is just a line cross the chart with only a few obs */

proc gplot data=safe_second;
plot t10*i /hm=5;
run;


My question:

How can I plot two into one chart?


Thanks.
SAS Super FREQ
Posts: 888

Re: Gplot with two different data sets: How to put into one chart

There may be a couple of options:

1. Turn the second dataset (with the simple line) into an annotation dataset and pass it into the first GPLOT.
2. Assuming the variable names are unique between the two datasets, you can directly merge the two datasets and use the OVERLAY option in GPLOT.

Hope this helps!

-- Dan
N/A
Posts: 0

Re: Gplot with two different data sets: How to put into one chart

Thanks, Dan.

I will follow your directions to try out. Will let you know the result.


Thanks for your help.


Cliff
Ask a Question
Discussion stats
  • 2 replies
  • 149 views
  • 0 likes
  • 2 in conversation