BookmarkSubscribeRSS Feed
bhr-q
Pyrite | Level 9

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
Pyrite | Level 9

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
Pyrite | Level 9

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 856 views
  • 3 likes
  • 4 in conversation