Procedure features: |
PLOT statement options
| label variable in plot request |
| LIST= |
| PLACEMENT= | |
|
Other features: |
|
This example illustrates the default placement of labels and how to
adjust the placement of labels on a crowded plot. The labels are values of
variable in the data set.(footnote 1)
This example also shows RUN group processing in PROC PLOT.
options nodate pageno=1 linesize=120 pagesize=37;
| data census;
input Density CrimeRate State $ 14-27 PostalCode $ 29-30;
datalines;
263.3 4575.3 Ohio OH
62.1 7017.1 Washington WA
...more data lines...
111.6 4665.6 Tennessee TN
120.4 4649.9 North Carolina NC
; |
| proc plot data=census;
plot density*crimerate=state $ state / box list=1
haxis=by 1000 vaxis=by 250;
title 'A Plot of Population Density and Crime Rates';
run;
|
The labels
Tennessee ,
South Carolina ,
Arkansas ,
Minnesota , and
South Dakota have penalties. The default placement states do not provide enough
possibilities for PROC PLOT to avoid penalties given the proximity of the
points. Seven label characters are hidden.
|
|
|
| plot density*crimerate=state $ state / box list=1
haxis=by 1000 vaxis=by 250
|
| placement=((v=2 1 : l=2 1)
((l=2 2 1 : v=0 1 0) * (s=right left : h=2 -2))
(s=center right left * l=2 1 * v=0 1 -1 2 *
h=0 1 to 5 by alt));
title 'A Plot of Population Density and Crime Rates';
run;
|
No collisions occur in the plot.
|
|
|
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.