BookmarkSubscribeRSS Feed
roroholic123
Calcite | Level 5

Hello,

 

I am trying to generate a figure displaying the percent distribution of a variable (y-axis) over the number of weeks (x-axis). Here is the code I used:

 

PROC FREQ DATA=sample;
TABLES weeks / plots=FreqPlot(scale=percent);/* Graph the percentage of "weeks" */
TITLE "Figure 1 The Proportional Distribution of weeks";
RUN;

 

The returned graph looks perfect for what I wanted. But my questions are:

1. How to export only the graph? The output also includes a freq table.

2. How to add a legend to this graph?

3. How to change the labels on both axes?

4. How to change the title of this graph? Currently the title is "Distributions of weeks" and I would like to change it to "Figure 1...".

1 REPLY 1
PaigeMiller
Diamond | Level 26

@roroholic123 wrote:

Hello,

 

I am trying to generate a figure displaying the percent distribution of a variable (y-axis) over the number of weeks (x-axis). Here is the code I used:

 

PROC FREQ DATA=sample;
TABLES weeks / plots=FreqPlot(scale=percent);/* Graph the percentage of "weeks" */
TITLE "Figure 1 The Proportional Distribution of weeks";
RUN;

 

The returned graph looks perfect for what I wanted. But my questions are:

1. How to export only the graph? The output also includes a freq table.

2. How to add a legend to this graph?

3. How to change the labels on both axes?

4. How to change the title of this graph? Currently the title is "Distributions of weeks" and I would like to change it to "Figure 1...".


  1. Use ODS to turn off parts of the output you don't want.
    ods exclude onewayfreqs;
  2. What do you mean by "legend"?
  3. The LABEL statement in PROC FREQ will let you change the horizontal axis label. I don't think you can change the vertical axis label (unless you modify a template somewhere)
  4. Change the TITLE statement.
--
Paige Miller