Hello programmers,
Please i would be glad to know what could be wrong with my code.
I am trying to plot my data to be the line format as opposed to being in the ugly looking format as in the pic.
I'm i missing an option that needs to be specified? Do i need to specify line?
data one; set two;run;
goptions reset=global ;
axis1 label =(f= 'arial/bo' h=1.9 "Age of patients" justify=c
f= 'arial/bo' h= 1.3 "(in years)")
order = (60 to 120 by 10)
value=(f= 'arial/bo'h=1.3 "60.0" "70.0" "80.0" "90.0" "100.0" "110.0" "120.0");
axis2 label =(a =90 f= 'arial/bo' h=1.9 "Systolic Blood Pressure mmHg")
order =(80 to 200 by 10)
value=(a= 90 f= 'arial/bo'h=1.3 "80.0" "90.0" "100.0" "110.0" "120.0" "130.0" "140.0" "150.0" "160.0" "170.0" "180.0" "190.0" "200.0");
symbol1 value=dot color=black interpol=none h=1.2;
symbol2 value=triangle color=black interpol=none h=1.5;
Legend1 across=1 down=2 noframe
position= (bottom right inside) mode=protect
label =(f= 'arial/bo' h=1.4 "Obesity")
value=(f= 'arial/bo' h=1.4 "0" "1");
proc gplot data= one;
plot systolic*aage=obese/haxis=axis1 vaxis=axis2 legend=legend1;
run;
It worked.
What option can i use to plot the graph in broken lines?
symbol line=
Any particular reason to use GPLOT over SGPLOT? It's a lot more customizable and much easier to use/learn than GPLOT.
Unfortunately most of the older references still use GPLOT but it's outdated for sure, and the graphic quality isn't nearly as nice as SGPLOT.
@ChuksManuel wrote:
Hello programmers,
Please i would be glad to know what could be wrong with my code.
I am trying to plot my data to be the line format as opposed to being in the ugly looking format as in the pic.
I'm i missing an option that needs to be specified? Do i need to specify line?
data one; set two;run; goptions reset=global ; axis1 label =(f= 'arial/bo' h=1.9 "Age of patients" justify=c f= 'arial/bo' h= 1.3 "(in years)") order = (60 to 120 by 10) value=(f= 'arial/bo'h=1.3 "60.0" "70.0" "80.0" "90.0" "100.0" "110.0" "120.0"); axis2 label =(a =90 f= 'arial/bo' h=1.9 "Systolic Blood Pressure mmHg") order =(80 to 200 by 10) value=(a= 90 f= 'arial/bo'h=1.3 "80.0" "90.0" "100.0" "110.0" "120.0" "130.0" "140.0" "150.0" "160.0" "170.0" "180.0" "190.0" "200.0"); symbol1 value=dot color=black interpol=none h=1.2; symbol2 value=triangle color=black interpol=none h=1.5; Legend1 across=1 down=2 noframe position= (bottom right inside) mode=protect label =(f= 'arial/bo' h=1.4 "Obesity") value=(f= 'arial/bo' h=1.4 "0" "1"); proc gplot data= one; plot systolic*aage=obese/haxis=axis1 vaxis=axis2 legend=legend1; run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.