Previous Page | Next Page

The BOXPLOT Procedure

Example 24.6 Creating Box-and-Whiskers Plots Using ODS Graphics

The following statements use ODS Graphics to produce a box plot of the flight delay data from Example 24.2. You invoke ODS Graphics with the ODS GRAPHICS ON statement.

ods graphics on;
title 'Box Plot for Airline Delays';
proc boxplot data=Times;
   plot Delay*Day /
      boxstyle = schematic
      nohlabel;
   label Delay = 'Delay in Minutes';
run;

The resulting box plot is shown in Output 24.6.1.

Output 24.6.1 Box Plot Produced Using ODS Graphics
Box Plot Produced Using ODS Graphics

ODS graphical displays, like traditional high-resolution graphs in SAS 9.2, are controlled by the ODS style currently in effect for the output destination where the box plots are produced. However, unlike high-resolution graphs, ODS graphs are unaffected by GOPTIONS and SYMBOL statements, and by PLOT statement options used to specify colors, fonts, and other features affecting box plot appearance. Options such as BOXSTYLE= and NOHLABEL are honored by the PLOT statement when producing ODS graphical output.

The following statements use the HORIZONTAL option, which is supported only by ODS Graphics, to produce a horizontal box plot:

title 'Box Plot for Airline Delays';
proc boxplot data=Times;
   plot Delay*Day /
      boxstyle = schematic
      horizontal;
   label Delay = 'Delay in Minutes';
run;
ods graphics off;

The horizontal box plot is shown in Output 24.6.2.

Output 24.6.2 Horizontal Box Plot
Horizontal Box Plot

Previous Page | Next Page | Top of Page