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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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