BookmarkSubscribeRSS Feed
Abishekaa
Obsidian | Level 7

Hello, I am creating a long figure in sas and would like to split it between two pages of output for clarity. Can anyone please help with this? Even though I found many sas forums on putting multiple figures into one page, I cannot find how to put one figure on two pages. Thanks!

4 REPLIES 4
Reeza
Super User
How exactly do you envision splitting the graphic?
Abishekaa
Obsidian | Level 7
Eg: I have a horizonal bar chart. I envision splitting to have exactly half of the chart in each page.
andreas_lds
Jade | Level 19

I haven't created that many bar charts, but all hat one request in common: the chart must fit on a single page. So i think you have to split the data and create both graphs manually. This could cause some trouble, for example if one bar is not long enough to be displayed on both pages.

ballardw
Super User

Destination? File format or actually to paper on a printer?

 

Can you share the code that currently makes your graph? And describe which VALUE you want to split the data at?

 

Easiest is likely going to involve adding a variable for BY processing to make a separate graph for each level of the BY variable.

An example:

/* basic plot*/
proc sgplot data=sashelp.class;
  vbar age/response=height;
run;
/*split into two plots*/
data newplot;
   set sashelp.class;
   plotnum = (age ge 14);
run;

proc sort data=newplot;
   by plotnum;
run;

proc sgplot data=newplot;
   BY plotnum;
   vbar age/ response=height;
run;

I suspect that you would want to examine the options involving by groups to suppress the default display of the by variable values but this might get you started.

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1340 views
  • 4 likes
  • 4 in conversation