BookmarkSubscribeRSS Feed
mjack
Calcite | Level 5


Hello Experts,

I am displaying graph on pdf using the proc sgplot procedure.

The graph gets displayed but the title and footnote are not getting displayed on the pdf.

ods listing close;
ods pdf file="pdffile.pdf";

title1 "Title1";
title2 "Title2";

footnote1 "FT1";
footnote2 "FT2";

proc sgplot data=sashelp.class;
y2axis min=0;
vbar age / response=height datalabel;
vline age / response=weight y2axis datalabel;
run;

ods pdf close;
ods listing;

Am I missing something here?

5 REPLIES 5
falguni_mathther
Calcite | Level 5

If footnotes and title you want to display within graph area then by changing the position of title and footnote,means writing before ods statement you can display them within pdf file. please mention detail if this will not work.

Cynthia_sas
Diamond | Level 26

Hi:

  Another possibility is to explicitly invoke the GTITLE and GFOOTNOTE options. Starting with SAS 9.3, you can use:

ods pdf file='xxx.pdf' gtitle gfootnote;

which will put the titles and footnotes INSIDE the boundary of the graph image. Otherwise, NOGTITLE and NOGFOOTNOTE cause the titles and footnotes to be OUTSIDE the graph image and placed under the control of ODS PDF.

If you do not have SAS 9.3 and/or, you are still not able to see your titles or footnotes, then I suggest you open a track with Tech Support. I ran your code in SAS 9.3 and see all the titles and all the footnotes inside the graph image in my output.

cynthia


title_footnote_pdf.png
falguni_mathther
Calcite | Level 5

This was the same output which i was able to display by changing the position of title and footnote working with SAS9.2. please try it out with your code.

and if you have 9.3 then those options will be the better choice to use.

hollandnumerics
Lapis Lazuli | Level 10

@Cynthia_sas wrote:

Starting with SAS 9.3, you can use:

    ods pdf file='xxx.pdf' gtitle gfootnote;

 

Cynthia,

 

Can we use GTITLE and GFOOTNOTE with ODS LISTING, as I'd like to be able to force titles and footnotes into free-standing PNG files too?

 

...........Phil

 

Philip R Holland
Recent book (see my blog site): "SAS Programming Experiences: A How-To Guide from a Power SAS User"
Cynthia_sas
Diamond | Level 26
HI, Phil:
I don't think that those are options for ODS LISTING. I don't see GTITLE/GFOOTNOTE or NOGTITLE/NOGFOOTNOTE as valid options for ODS LISTING: http://support.sas.com/documentation/cdl/en/odsug/67921/HTML/default/viewer.htm#n1lyhxs0ue101in1snow...

GTITLE and GFOOTNOTE force the title inside the boundary of the graph, which is the default behavior for SAS title and footnote statement. If you are making only a PNG file, without an ODS "wrapper" file, like HTML or RTF or PDF, then there wouldn't be anything "outside" the boundary of the graph for ODS to control.

I wonder whether ANNOTATE would get you close to what you want. Probably worth a question to the graph gurus in Tech Support.

cynthia

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

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
  • 5 replies
  • 5663 views
  • 1 like
  • 4 in conversation