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

Hi, 

I do not manage to save my plots in a pdf file with 3x3 layout format.

It is working fine with `ods graphics` but not with `ods pdf`.

Here is a simple example. 

 

%macro plot_hist;
%do i=1 %to 9;

data sample (keep=age);
 do i = 1 to 100;
   age = abs (floor (rand('triangle',0.1) * 100 ) );
   output;
 end;
run;

ods region;
proc sgplot data=sample;
 HISTOGRAM age / binwidth=1 binstart=0 ;
 TITLE "Age";
 xaxis values=(0 to 100 by 1) offsetmin=.01 offsetmax=.01 ;
RUN; 
%end;
%mend;

ods pdf file="&DIR_RES\desc_histo.pdf";
/*ods graphics / width=1000px height=400px;*/
ods layout start rows=3 columns=3;
%plot_hist
ods layout end;
ods _all_ close;

 Thanks for your assistance

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

Please refer to this section to adjust the graph size of sgplot.

For example, try the following code.

ods graphics on / width=2in;
ods graphics on / height=2in;

 

View solution in original post

2 REPLIES 2
japelin
Rhodochrosite | Level 12

Please refer to this section to adjust the graph size of sgplot.

For example, try the following code.

ods graphics on / width=2in;
ods graphics on / height=2in;

 

ctisseuil
Fluorite | Level 6
Thank you very much !

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 879 views
  • 0 likes
  • 2 in conversation