Sample 25595: Creating and modifying box plots using SYMBOL statement
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 1, Chapter 8.
For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GSYCMBP1 |
| TITLE: GSYCMBP1-Creating and Modifying Box Plots |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS AXIS SYMBOL GPLOT |
| PROCS: GPLOT |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| |
| REF: SAS/GRAPH REFERENCE GUIDE |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(black blue green red)
ftitle=swissb ftext=swiss htitle=6 htext=4;
/* Create the data set GRADES */
data grades;
input section $ grade @@;
datalines;
A 74 A 89 A 91 A 76 A 87 A 93 A 93 A 96 A 55
B 72 B 72 B 84 B 81 B 97 B 78 B 88 B 90 B 74
C 62 C 74 C 71 C 87 C 68 C 78 C 80 C 85 C 82
;
/* Define title and footnote */
title1 'Comparison: Grades by Section';
footnote1 j=r h=3 'GSYCMBP1(a) ';
/* Define symbol characteristics */
symbol interpol=boxt20 /* box plot */
co=blue /* box and whisker color */
bwidth=6 /* box width */
value=square /* plot symbol */
cv=red /* plot symbol color */
height=4; /* symbol height */
/* Define axis characteristics */
axis1 label=none
value=(t=1 'Monday' j=c 'section'
t=2 'Wednesday' j=c 'section'
t=3 'Friday' j=c 'section')
offset=(5,5)
length=50;
/* Generate plot */
proc gplot data= grades;
plot grade*section / haxis=axis1
vaxis=50 to 100 by 10;
run;
/* Define footnote for second plot */
footnote j=r h=3 'GSYCMBP1(b) ';
/* Define symbol for second plot */
symbol interpol=boxt10 width=2;
plot grade*section / haxis=axis1
vaxis=50 to 100 by 10;
run;
quit;

This example shows how to create box plots and how to specify SYMBOL definitions so data outside the box-plot range can be represented with data points. It also shows how to change a box plot's percentile range to see if the new range encompasses the data.
| Type: | Sample |
| Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Special Plot types SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Symbols/Interpolation
|
| Date Modified: | 2005-09-22 03:03:13 |
| Date Created: | 2005-05-23 14:17:51 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |