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

Does anyone know of an easy way to save SGPANEL graphics to a JPEG file with at least 300 dpi?

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

You can do it with a combination of ODS LISTING and ODS GRAPHICS

 

ods listing gpath="c:\temp\myGraphs" image_dpi=300 device=jpeg;
ods graphics / imagename="file name without extension";

But I recommend not to use device=jpeg, you will get png files instead which are better behaved IMHO.

PG

View solution in original post

4 REPLIES 4
slangan
Obsidian | Level 7

I think if you use a variation of the following code, you can get it

 

ods graphics on /
      width=4in
      outputfmt=jpeg

      image_dpi=300
      imagemap=on
      imagename="MyPlot"
      border=off;

PaigeMiller
Diamond | Level 26

I don't see the option for image_dpi in the documentation for ODS GRAPHICS and when I use it, I get an error there.

 

The idea of setting the dpi (should that be ppi for pixels per inch?) is meaningless anyway, because digital images cannot be measured in images, only in pixels.

 

If you really want, you can set the number of pixels in the output image, such as

 

ods graphics/outputfmt=jpg height=800px width=1200px;
proc sgpanel data=sashelp.heart noautolegend;
  title "Cholesterol Distribution in Heart Study";  
panelby sex;
histogram cholesterol; density cholesterol; run;

 

--
Paige Miller
slangan
Obsidian | Level 7

 


@PaigeMiller wrote:

I don't see the option for image_dpi in the documentation for ODS GRAPHICS and when I use it, I get an error there.

 


IMAGE_DPI is mentioned under "Controlling Image Resolution"

http://support.sas.com/documentation/cdl/en/grstatproc/67909/HTML/default/viewer.htm#n18kg7jqymqaudn...

PGStats
Opal | Level 21

You can do it with a combination of ODS LISTING and ODS GRAPHICS

 

ods listing gpath="c:\temp\myGraphs" image_dpi=300 device=jpeg;
ods graphics / imagename="file name without extension";

But I recommend not to use device=jpeg, you will get png files instead which are better behaved IMHO.

PG

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 1845 views
  • 1 like
  • 4 in conversation