Does anyone know of an easy way to save SGPANEL graphics to a JPEG file with at least 300 dpi?
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.
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;
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;
@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"
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.