The SAS Output Delivery System and reporting techniques

Outputting a graph from PROC FREQ

Accepted Solution Solved
Reply
Regular Contributor
Posts: 177
Accepted Solution

Outputting a graph from PROC FREQ

Hello,

 

At the end of my SAS programm, I have an ODS section where I send tables to an rtf file (all together). I use PROC TABULATE and PROC REPORT. If I need a part of an output (from a model for example), I save it as a dataset and then use TABULATE or REPORT to send it to the same rtf with the rest of the output. If I want a plot, easy, inside the ODS section I use SGPLOT or another procedure.

 

Now I want a MOSAIC plot. I couldn't find an easy way of plotting one besides using PROC FREQ. The question is, how do I output the plot and only the plot, to an rtf file ? In other words, can I tell SAS not to print anything from the PROC FREQ apart from the MOSAIC plot ?

 

Thank you !


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
Grand Advisor
Posts: 9,335

Re: Outputting a graph from PROC FREQ


ods graphics on;
ods select MosaicPlot;
proc freq data=sashelp.class ;
table sex*age/plot(only)=mosaic;
run;

View solution in original post


All Replies
Solution
‎09-25-2015 06:23 AM
Grand Advisor
Posts: 9,335

Re: Outputting a graph from PROC FREQ


ods graphics on;
ods select MosaicPlot;
proc freq data=sashelp.class ;
table sex*age/plot(only)=mosaic;
run;
Regular Contributor
Posts: 177

Re: Outputting a graph from PROC FREQ

Thank you. Since I am outputting it, is it possible to delete the automatic title of the plot ? I will add my own using title2 ''....
Grand Advisor
Posts: 9,335

Re: Outputting a graph from PROC FREQ

Well, I am not expert of ODS Graphic. But you could try this :

 


ods select MosaicPlot;

title1 'ssssssss';
title2 'xxxxxxxxx';
ods text=' ' ;
proc freq data=sashelp.class ;
table sex*age/plot(only)=mosaic;
run;
Regular Contributor
Posts: 177

Re: Outputting a graph from PROC FREQ

[ Edited ]

Thank you ! I tried it and it didn't delete the title from the plot. When I say title, I don't mean the title of the output, I mean the actual title of the plot, inside the white square of the plot. I am not sure it's even possible.

Super Contributor
Posts: 394

Re: Outputting a graph from PROC FREQ

Check the NOGTITLE option on the ODS RTF statement.

SAS Super FREQ
Posts: 3,234

Re: Outputting a graph from PROC FREQ

Use the %MODTMPLT macro, which is described in the SAS/STAT documentation:

title;    /* clear the title */
%modtmplt(options=replace, template=Base.Freq.Graphics.MosaicPlot, steps=t)
proc freq data=sashelp.class;
tables sex*age / plots(only)=MosaicPlot;
run;
Post a Question
Discussion Stats
  • 6 replies
  • 2525 views
  • 5 likes
  • 4 in conversation