Data visualization with SAS programming

Title inside the graph (and not above) with proc sgplot

Reply
Contributor
Posts: 24

Title inside the graph (and not above) with proc sgplot

 Dear all,

I create some graphs in png that I put later in ods rtf. I would like to have the title inside the graph because i have sometimes 3 or 4 graphs on same page but i did not succeed til now..

 

Please find my code:

 

ODS GRAPHICS / RESET IMAGENAME = 'AdminMoy' IMAGEFMT =png
HEIGHT = 3.15 in WIDTH = 4.9 in;
ODS LISTING GPATH = '\\vcarapp010\Rapports\01-ETUDE PIVOT\Graphs' ;


proc sgplot data=alldata /*noautolegend*/;
series x=nbDay y=pmd /legendlabel='Setting of right input pressure' LINEATTRS=(color=PAB pattern=solid);
series x=nbDay y=DP /legendlabel='Setting of avg. L/R admission P. ratio' LINEATTRS=(color=red pattern=solid);
xaxis label='days' /min=0;
yaxis interval=AUTO integer label='Pressure (mmHg)' VALUES= (0 to 8 by 1) GRID;
refline 0.0083 /axis=X label="switch in auto mode" lineattrs=(color=black) LABELATTRS=(Color=red Family=Arial Size=6 Style=Italic Weight=Bold); /*met une ligne de référence verticale pour un évenement*/
keylegend/ location=outside position=bottom down=2;
title1 "Patient: PA001FRLAE - EN001FRLAE";
title2 "Time trajectories post-implant for setting of right input pressure and avg. L/R admission P. ratio";
run;
quit;

Please find enclosed image.

 

Thank you

Attachment
Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Title inside the graph (and not above) with proc sgplot

Why not just create the RTF straight off an use:

ods rtf file="..." bodytitle;

...

ods rtf close;
Contributor
Posts: 24

Re: Title inside the graph (and not above) with proc sgplot

Because i manage also a content in doc file and do not support bodytitle in option of ods rtf.

 

declaration of ods rtf:


ods rtf file='\\vcarapp010\Rapports\01-ETUDE PIVOT\Report\Hemodynamical Report_PA001FRLAE.doc' dpi=300 contents=yes toc_data ;
ods noproctitle;

I would like to have the title in png file.

SAS Super FREQ
Posts: 889

Re: Title inside the graph (and not above) with proc sgplot

In what environment are you running this code? Is it DMS (display manager), EG (Enterprise Guide), or SAS Studio?

Contributor
Posts: 24

Re: Title inside the graph (and not above) with proc sgplot

Entreprise guide

Contributor
Posts: 24

Re: Title inside the graph (and not above) with proc sgplot

Ok I have just find the solution on web:

need to put 

ODS tagsets.sasreport13(ID=EGSR) gtitle;

Thank you all for support,

 

Regards,

 

 

SAS Super FREQ
Posts: 889

Re: Title inside the graph (and not above) with proc sgplot

By default, EG sets NOGTITLE and NOGFOOTNOTE for the graph output, which might explain what you're seeing. To get titles and footnotes inside the graph in EG, do the following steps:

 

1. Go to Tools->Optoins

2. In the left pane, under "Results", click on the "Graph" item

3. In the right pane, clicl on the two check boxes to include titles and footnotes in the graph

4. Re-run your test

 

Hope this helps!

Dan

Ask a Question
Discussion stats
  • 6 replies
  • 223 views
  • 0 likes
  • 3 in conversation