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
SAS Super FREQ

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
Pyrite | Level 9

@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
Holland Numerics: Blog and Forums
http://blog.hollandnumerics.org.uk
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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