Data visualization with SAS programming

Plot multiple values on the same axis

Accepted Solution Solved
Reply
Super Contributor
Posts: 260
Accepted Solution

Plot multiple values on the same axis

[ Edited ]

Hello SAS experts,

I'd like to create a Desired Plot on the right in the image?

Any comments or demo codes highly appreciated.

 

Acknowledgement: The code here was suggested by DanH_sas. 

proc import datafile="...\plot.txt"
out=plot
dbms=tab replace;
guessingrows=max;
run;
proc sgplot data=PLOT /*data attached*/;  
series x=risk_out y=mean_bias / group=agecat;
series x=risk_in y=mean_bias / group=agecat x2axis transparency=1;
run;

 PLOT_IMAGE_NEW.png

 

 

 

 


Accepted Solutions
Solution
‎02-03-2018 02:00 PM
SAS Super FREQ
Posts: 1,042

Re: Plot multiple values on the same axis

To get that graph, you will also need a REVERSE:

 

proc import datafile="...\plot.txt"
out=plot
dbms=tab replace;
guessingrows=max;
run;
proc sgplot data=PLOT /*data attached*/;  
series x=risk_out y=mean_bias / group=agecat;
series x=risk_in y=mean_bias / group=agecat x2axis transparency=1;
x2axis reverse;
run;

Hope this helps!
Dan

View solution in original post


All Replies
Solution
‎02-03-2018 02:00 PM
SAS Super FREQ
Posts: 1,042

Re: Plot multiple values on the same axis

To get that graph, you will also need a REVERSE:

 

proc import datafile="...\plot.txt"
out=plot
dbms=tab replace;
guessingrows=max;
run;
proc sgplot data=PLOT /*data attached*/;  
series x=risk_out y=mean_bias / group=agecat;
series x=risk_in y=mean_bias / group=agecat x2axis transparency=1;
x2axis reverse;
run;

Hope this helps!
Dan

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 115 views
  • 1 like
  • 2 in conversation