University of Rochester Medical Center
SearchDirectoryNewsEventsStrong HealthURMC Home

SAS Helpful Hints

Proc Gplot(Boxplots)

Here is a set of boxplots by treatment group. I have included many of my favorite graphic options to improve the appearance of the graph. Feel free to modify the options to suite your own personal taste.

Title1 Font=Centx Height=2 'BoxPlots';

Goptions Device=Win Colors=(Black White Blue Red)
    Display Fby=Centx Hby=2 Cback=White;

Axis1 Width=2 Major=(Width=2) Minor=(Width=2) Value=(Font=Duplex Height=2)
    Label=(Angle=90 Rotate=0 Font=Centx Height=2 'Observed Values');

Axis2 Width=2 Major=(Width=2) Minor=(Width=2) Value=(Font=Duplex Height=1.4)
    Label=none Order=1 To 8 By 1;

Legend1 Label=None Value=(Font=Centx Height=2)
    Across=2 Down=1 Position=(Outside|Inside Top|Middle|Bottom Left|Center|Right);
Symbol1 Value=Plus Interpol=Box Line=1 Width=2 Bwidth=2 Color=Blue;
Symbol2 Value=Plus Interpol=Box Line=1 Width=2 Bwidth=2 Color=Red;

Proc Gplot Data=work.A Gout=work.plot;
    Plot value*scale=treatment / Frame Vaxis=axis1 Haxis=axis2 Legend=Legend1;
    Label scale='Scale' treatment='Treatment';
    Format scale fscale. treatment ftreat.;
Run;

Please send your comments and suggestions about this web page to A. Watts (watts@bst.rochester.edu)