BookmarkSubscribeRSS Feed
bhr-q
Quartz | Level 8

Hello,

when I turn on ODS graphics, I sometimes do not see any graphs in the output, while other times they appear as expected. I checked the settings under Tools > Options > Preferences and ensured that ODS Graphics is enabled. but I am still experiencing issues with the display of graphs; there are no relevant messages or errors in the log.

 

Thanks

6 REPLIES 6
JosvanderVelden
SAS Super FREQ
Please specify with full details one example of the issue you experience! SAScode, logfile, etc if possible using a sas dataset available as sample dataset in sashelp. TIA
bhr-q
Quartz | Level 8

for instance, when I run the below code, it does not show me any graph, and I just see the correlation results.

 

ods graphics on;
title "Computing Pearson Correlation Coefficients";
proc corr data=exercise nosimple rank;
var Rest_Pulse Max_Pulse Run_Pulse Age;
with Pushups;
run;title;
ods graphics off;t
FreelanceReinh
Jade | Level 19

Hello @bhr-q,

 

You must use the PLOTS= option of the PROC CORR statement to create a graph with this procedure: either plots=scatter or plots=matrix or plots=all (see section ODS Graphics of the procedure documentation and, for more details, the documentation of the PLOTS= option).

bhr-q
Quartz | Level 8

Thanks for your answer, yes I can get the plot with the below code:

proc corr data=exercise nosimple  plots = matrix;
var Rest_Pulse Max_Pulse Run_Pulse Age;
with Pushups;
run;

but my question is to get the plot using ODS graphics

StatsMan
SAS Super FREQ

When you specify PLOTS=MATRIX, then PROC CORR does produce the matrix plot of correlations. That plot is done using ODS graphics. 

 

Some procedures produce plots without the use of special options inside the procedure. PROC CORR does not produce that ODS graph without PLOTS=MATRIX on the PROC CORR statement. 

FreelanceReinh
Jade | Level 19

@bhr-q wrote:

my question is to get the plot using ODS graphics


You are using ODS graphics. As you mentioned in your initial post, you had to "turn on ODS graphics" (using the ODS GRAPHICS statement) and this is indeed the prerequisite for the PLOTS= option to work. Otherwise, the warning

WARNING: You must enable ODS graphics before requesting plots.

would be written to the log. The PLOTS= option of PROC CORR was introduced in SAS version 9, as were ODS graphics.

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 716 views
  • 3 likes
  • 4 in conversation