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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 444 views
  • 5 likes
  • 3 in conversation