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

Hello,

 

I am trying to create a panel of scatter plots in a pdf file for comparison. With the code below, each individual scatter plot is printed on one page. In total, there are 450+ distinct values of ID. Is there a way to panel the scatterplots so I can compare groups of IDs together on a single page? I realize all plots for the IDs won't fit on a single page, but it would be easier to scan a few pages than 450+!

 

Thanks for any help or insights.

 

Dhrumil

 

ods pdf file='path\scatter.pdf';

proc sgplot data=&dsn;
by ID;
scatter x=year y=fcst;
run;

ods pdf close; 
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

This should work for you:

ods pdf file='path\scatter.pdf';

proc sgpanel data=&dsn;
panelby ID;
scatter x=year y=fcst;
run;

ods pdf close; 

You can set the number of rows and/or columns for the panel, or just let the procedure try to find the best panel size for you.

 

Hope this helps!

Dan

View solution in original post

1 REPLY 1
DanH_sas
SAS Super FREQ

This should work for you:

ods pdf file='path\scatter.pdf';

proc sgpanel data=&dsn;
panelby ID;
scatter x=year y=fcst;
run;

ods pdf close; 

You can set the number of rows and/or columns for the panel, or just let the procedure try to find the best panel size for you.

 

Hope this helps!

Dan

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1805 views
  • 0 likes
  • 2 in conversation