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!
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;
Just a note that GOPTIONS don't affect the ODS Graphics output, and SGPLOT is under ODS Graphics.
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.
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.
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;
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 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: