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

Hi all, 

 

I'm trying to output my 3 graphs I produced using SGPLOT into PDF. I use ods graphics options to try to control for the size and fonts of the graphics but the graphs keep turning out to be way to small for an 8x11 paper. I've uploaded a sample output. Below is my code:

 

 

goptions /*reset=all*/ device=PDF ftitle="Thorndale AMT" ftext="Thorndale AMT" noborder;
options papersize=letter nodate nonumber orientation=landscape leftmargin=.5in rightmargin=.5in topmargin=.5in bottommargin=.5in;
options nobyline;

ods pdf file="&odsfile" dpi=300;
ods graphics on reset=all/ width=10in scale=on border=off imagefmt=png; /*outputfmt=pdf; */

 

title1 J=C font="&font/bold" H=14pt "TITLE";
Footnote1 f="Thorndale AMT" justify=left h=10pt "FOOTNOTE";


proc sgplot data=SOURCE; 


series x=TIME y=PRICE/
lineattrs=(pattern=1)
group=CUSTOMER
grouplc=CUSTOMER
name='grouping';
keylegend 'grouping' / type=linecolor;
xaxis label="Time" values=(0 to 108 by 6);
yaxis label="Price Change" values=(-0.6 to 0.6 by 0.1);
refline 0/ lineattrs=(thickness=0.5 color=black);
format TIME best12. PRICE percent7.2;
run;

 

ods pdf close;

 

The title is positioned where I want it to ve (i.e. follows the margin of 0.5 inch left/right as coded) but the graph itself is still very tiny even after I set it as width=10in under ods graphics. Anyone know what the problem is? 

 

Thanks!

 

 


Untitled.png
1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

A few notes:

1) You don't need ODS GRAPHICS ON to call PROC SGPLOT.

2) Be sure to put the RESET=ALL option after the slash. The way you have it is a syntax error.

 

ODS graphics on / reset width=10in scale=on border=off imagefmt=png;

 

 

View solution in original post

5 REPLIES 5
Reeza
Super User

Just a note that GOPTIONS don't affect the ODS Graphics output, and SGPLOT is under ODS Graphics.

DanH_sas
SAS Super FREQ

I do not get a "tiny" graph at SAS 9.4m3. What version of SAS are you using? Also, you might want to remove the NOGTITLE option to reclaim some of the space between the graph and the title.

dl0324
Fluorite | Level 6
I'm using SAS 9.4 TS Level 1M2. I got rid of NOGTITLE but seems to have no change. The overall graph and titles are all shown in a small box that's not fitted to the size of the pdf. I uploaded the sample output hope it helps.
DanH_sas
SAS Super FREQ

I still was not able to reproduce the problem with the given test program; but looking at the picture you uploaded, it looks like the most likely culprit is an ODS GRAPHICS / RESET hiding somewhere in your code that effectively resets your graph size to 640x480.

Rick_SAS
SAS Super FREQ

A few notes:

1) You don't need ODS GRAPHICS ON to call PROC SGPLOT.

2) Be sure to put the RESET=ALL option after the slash. The way you have it is a syntax error.

 

ODS graphics on / reset width=10in scale=on border=off imagefmt=png;

 

 

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
  • 5 replies
  • 7195 views
  • 0 likes
  • 4 in conversation