BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kyra
Quartz | Level 8

 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.

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

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;

 

View solution in original post

7 REPLIES 7
ballardw
Super User

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.

Kyra
Quartz | Level 8

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;

DanH_sas
SAS Super FREQ

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;

 

DanH_sas
SAS Super FREQ

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.

DanH_sas
SAS Super FREQ

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.

Reeza
Super User
I moved your post to the Graphics forum.
I also concur with @ballardw, change to SGPLOT and your graphics will already be much better quality.

Your code shows no spaces between the quotes and image_dpi so that can be an issue, I suspect you'd see a note or warning about it?

Ksharp
Super User

ods rtf file='C:\Users\khetap03\Desktop\Lillirecent\boxplotcreatinine.rtf'   dpi=600;

ods listing style=listing  image_dpi=600 ;

proc sgplot ........

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2051 views
  • 5 likes
  • 5 in conversation