BookmarkSubscribeRSS Feed
Quentin
Super User

I'm using SGPANEL with ODS PDF with orientation=landscape and trying to make a plot that is 10 inches wide.

 

When I try below code, SGPANEL leaves a lot of space on the right, almost as if it's leaving room for an extra column.  How can I make the SGPANEL plot fill the page?

 

options orientation=landscape nocenter;
ods graphics/reset=all border=off width=10in;

ods listing close;
ods pdf file="%sysfunc(pathname(work))\Foo.pdf" style=pearl notoc ;    

title1 "Width of sgplot plot is good" ;
proc sgplot data=sashelp.class ;
  scatter x=height y=weight ;
run ;
title1 ;

title1 "Width of sgpanel plot is too narrow" ;
proc sgpanel data=sashelp.class ;
  panelby sex/ layout=rowlattice onepanel ;
  scatter x=height y=weight ;
run ;
title1 ;

ods _all_ close ;
ods listing ;

My pdf looks like:

Quentin_0-1768339058565.png

I tried making the graph narrower (8in or 9in) in case I was hitting the margins, but no luck.

 

SGPLOT works fine.

3 REPLIES 3
DanH_sas
SAS Super FREQ

Try specifying both the width and the height on the ODS GRAPHICS statement. By default, the aspect of the graph is maintained when you specify only width or height. Hope this helps!

Quentin
Super User

Thanks for the thought Dan.  

 

When I try e.g. width=10in height=7in  the plot is empty and the log tells me:

Cell height -34 is smaller than the minimum cell height 1. All contents are removed from the layout.
Cell height -34 is smaller than the minimum cell height 1. All contents are removed from the layout.
sbxkoenk
SAS Super FREQ

Try using these options on the panelby statement (behind the forward slash):

LAYOUT=panel columns=4 novarname

Koen

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 save with the early bird rate—just $795!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 67 views
  • 0 likes
  • 3 in conversation