BookmarkSubscribeRSS Feed
josuerodrigues
Calcite | Level 5

Hi.

I did a plot using the procedure SGPLOT but I wouldn't say I liked the resolution when I put in my docs. I want to know how I can save my graph in my laptop with 600 dpi as a JPG.

 

I'm using SAS® OnDemand for Academics and my node is: 

proc sgplot data=PCA aspect=1;
styleattrs datasymbols=(trianglefilled circlefilled squarefilled plus)
datacontrastcolors=(crimson bioy blueviolet darkgreen dodgerblue);
scatter x=Prin1 y=Prin2 / group=Adubo_clone markerattrs=(size=10px);
xaxis min=-2.5 max=2.5 label="Component 1 (23,51%)";
yaxis min=-2 max=2 label="Component 2 (21,91%)";
keylegend / location=outside position=right titleattrs=(weght=bold size=9pt) valueattrs=(color=black size=9pt);
run;

2 REPLIES 2
sbxkoenk
SAS Super FREQ
ods listing gpath='c:\temp' image_dpi=600 ;
ods graphics on / outputfmt=jpg ;

proc sgplot data=sashelp.class(rename=(height=Prin1 weight=Prin2 sex=Adubo_clone)) aspect=1;
styleattrs datasymbols=(trianglefilled circlefilled squarefilled plus)
datacontrastcolors=(crimson bioy blueviolet darkgreen dodgerblue);
scatter x=Prin1 y=Prin2 / group=Adubo_clone markerattrs=(size=10px);
*xaxis min=-2.5 max=2.5 label="Component 1 (23,51%)";
*yaxis min=-2 max=2 label="Component 2 (21,91%)";
keylegend / location=outside position=right titleattrs=(weight=bold size=9pt) valueattrs=(color=black size=9pt);
run;

/* With the SG procedures and ODS Graphics, once you increase the resolution of your graphics output, */
/* you might start seeing java.lang.OutofMemoryError or a Java heap space memory error.               */
/* If you encounter this problem, see SAS Note 31184, which documents ways to address the issue by    */
/* changing your SAS configuration file.                                                              */

/* end of program */

Usage Note 31184:
The error "java.lang.OutOfMemoryError: Java heap space" might occur when you use ODS Graphics with a large data set
https://support.sas.com/kb/31/184.html

 

BR, Koen

 

Tom
Super User Tom
Super User

If you are running SAS On Demand then SAS is NOT running on your laptop, but on some computer that SAS has provided.  So your code will have to write the file on that server.  You can then use SAS/Studio to download the file to your laptop.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1194 views
  • 5 likes
  • 3 in conversation