Data visualization with SAS programming

Proc gplot and ods pdf

Reply
Contributor
Posts: 57

Proc gplot and ods pdf

Hi,

I have a dataset with variables

AN
w_24
f_24
g_24
w_25
f_25
g_25
w_log24
f_log24
g_log24
w_log25
f_log25
g_log25

I need 4 different for each AN value. So I used this code.

proc gplot data=abc;
title "an=#byval(an)";
by an;

plot g_24*w_24 g_25*w_25 overlay/nolegend
anno=anno_markers;

plot f_24*w_24 f_25*w_25 overlay/nolegend
anno=anno_markers;

plot g_log24*w_log24 g_log25*w_log25 overlay/nolegend
anno=anno_markers;

plot f_log24*w_log24 f_log25*w_log25 overlay/nolegend
anno=anno_markers;

run;
quit;

Now I need to ods it. The constraint is to fit all the 4 plots for each AN in one page. Meaning, if there are 8 AN then I need to have 9 pages. Each page should contain all the 4 plots.

I tried ODS pdf file= startpage=n0 column=2;
goptions vsize=4in;

This gives 2 columns in each page. Each column contains 2 graphs. In the crude form it satisfies the requirements but they are in 2 different start point.

|
|
| |
| |
|
|

The alignment is not clear.

I tried ods layout column=2 rows=2;

not getting the desired result.

I tried tagsets.htmlpanel. The alignment is fine but the graph is nnot getting printed.

Please help.

Thanks,
Sandhya.
SAS Super FREQ
Posts: 864

Re: Proc gplot and ods pdf

What version of SAS are you using?
Contributor
Posts: 57

Re: Proc gplot and ods pdf

SAS 9.2

Sandhya.
SAS Super FREQ
Posts: 8,643

Re: Proc gplot and ods pdf

Hi:
If you have SAS 9.2, then you might consider using the SGPANEL procedure to get your related graphs placed into one page in the ODS PDF destination.

Just a comment about ODS HTMLPANEL -- this is an HTML-based destination -- there is no guarantee that the printed output will "fit" in a printed page, since the printing is handled by the browser interface to the printer and SAS really has nothing to do with how the HTML prints.

There are a lot of good references on using the SGPANEL procedure from recent SAS user group meetings.

cynthia
[pre]
options orientation=landscape nodate nonumber;
ods listing close;
ods pdf file='c:\temp\panel.pdf';

proc sgpanel data=sashelp.heart;
panelby chol_status sex;
scatter x=ageatdeath y=agechddiag;
run;
ods pdf close;
[/pre]
Contributor
Posts: 57

Re: Proc gplot and ods pdf

Hi Cynthia,

PROC GREPLAY with template option worked.

Thank you,

Sandhya.
Post a Question
Discussion Stats
  • 4 replies
  • 159 views
  • 0 likes
  • 3 in conversation