I am trying to increase the resolution of the line graph produced to 600dpi. I am not sure where i am making mistakes in my code- The resolution is still 96 dpi.
ods rtf file='C:\Users\khetap03\Desktop\Lillirecent\boxplotcreatinine.rtf'image_dpi=600;
ods listing style=listing;
ods graphics on / width=4.5in height=3.5in;
goptions reset=all;
symbol1 c=blue v=star h=.8 i=j;
symbol2 c=red v=dot h=.8 i=j;
symbol3 c=green v=square h=.8 i=j;
axis1 order=(50 to 100 by 5) label=( 'Means');
axis2 value=(10 to 100 by 10) label=('Time');
proc gplot data=means1;
plot estimate*time=obesity / vaxis=axis1 haxis=axis2;
run;
quit;
ods rtf close;
Thank you very much in advance.
Change SCATTER to SERIES.
series y= estimate x= time/ group=obesity ;
If you want to see both the line and the markers, add the MARKERS option:
series y= estimate x= time/ group=obesity markers;
First thing would we to change to Proc SGPLOT instead of GPLOT. Gplot is designed to create device, i.e. printer, based graphics and so does not work well with ODS options.
Try this instead of Gplot:
proc sgplot data=means1; scatter y= estimate x= time/ group=obesity ; yaxis label='Means' values=(50 to 100 by 5); xaxis label='Time' values=(10 to 100 by 10) run;
If that comes close then it will be time to delve into the approaches to control markers and colors, either Styleattrs statement or Dattrmap data set.
Hi ,
when i run gplot i get line graph as output but when i run sgplot i get some dots on the graph. Please let m,e know what is wrong with my sgplot code.
goptions reset=all;
symbol1 c=blue v=star h=.8 i=j;
symbol2 c=red v=dot h=.8 i=j;
symbol3 c=green v=square h=.8 i=j;
axis1 order=(50 to 100 by 5) label=( 'Means');
axis2 value=(10 to 100 by 10) label=('Time');
proc gplot data=means1;
plot estimate*time=obesity / vaxis=axis1 haxis=axis2;
run;
quit;
proc sgplot data=means1;
scatter y= estimate x= time/ group=obesity ;
yaxis label='Means' values=(50 to 100 by 5);
xaxis label='Time' values=(10 to 100 by 10);
run;
Change SCATTER to SERIES.
series y= estimate x= time/ group=obesity ;
If you want to see both the line and the markers, add the MARKERS option:
series y= estimate x= time/ group=obesity markers;
The IMAGE_DPI option is not used by SAS/Graph output, like GPLOT would give you. ODS Graphics output uses that option. I would use SGPLOT, as @ballardw suggested.
One other thing...
For RTF output, the default output type is EMF, which is a vector-based output. If you really want an image, specify something like OUTPUTFMT=PNG on the ODS GRAPHICS statement.
ods rtf file='C:\Users\khetap03\Desktop\Lillirecent\boxplotcreatinine.rtf' dpi=600;
ods listing style=listing image_dpi=600 ;
proc sgplot ........
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.