HI everyone,
I managed to plot 4 sgplot graphs on a single pdf using ODS, as shown below.
But I would also like to provide an overall title for the 4 graphs.
My attempts using proc gslide were unsuccessfull, as the title from proc gslide is just being repeated for all the graphs
Does anyone have an alternative idea how to set an overall title, while at the same time use separate titles for the graphs ?
Thanks
--
data sample; var=1; run;
proc gslide;
title "Overall Title" ;
run;
options orientation = landscape;
ods graphics on / width = 5in height = 3in;
ods pdf file="C:\pdf.pdf" columns=2 startpage=never;
proc sgplot data = sample;
vbar var;
run;
proc sgplot data = sample;
vbar var;
run;
ods pdf startpage=now;
proc sgplot data = sample;
vbar var;
run;
proc sgplot data = sample;
vbar var;
run;
ods pdf close;
Put a
Title "This is the title I want to appear on all graphs";
Before the first Proc sgplot statement;
You will want to place a
Title;
after the last Proc to clear the title from appearing on other procedure results later.
Thanks for this example of PDF columns and controlling PDF page breaks, to put multiple PROC SGPLOT or GTL outputs on the same PDF page.
This is a much better approach than the rather awkward solution that SAS offer in Sample 41461!!
You can use the ODS TEXT option to create your own exterior title. Try this simple example:
ods _all_ close;
ods escapechar="~";
ods pdf file="temp.pdf" startpage=never;
ods text="~{style [just=center fontweight=bold fontsize=14pt] This is an OVERALL title}";
ods graphics / height=400px;
title "graph title 1";
proc sgplot data=sashelp.class;
vbar age;
run;
title "graph title 2";
proc sgplot data=sashelp.class;
vbar sex;
run;
ods _all_ close;
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.