The BUBBLEPLOT statement
displays one bubble for each row in the data, provided that row contains
nonmissing values for X, Y, and SIZE. By default, the bubbles are
displayed as filled, outlined circles. Regardless of the data order,
the bubbles are always drawn from the largest size to the smallest
size.
By default, the minimum
and maximum values of the SIZE= column establish a range over which
the bubble radii increase in linear proportion. The actual drawing
size of the smallest and largest bubble is set automatically. You
can adjust the smallest and largest bubble sizes with the
BUBBLERADIUSMIN= and
BUBBLERADIUSMAX= options. In these cases where the
bubble sizes are proportional to each other, the default setting RELATIVESCALE=TRUE
is appropriate.
If the SIZE= values
are in the same units as the X and Y values, and both X and Y are
numeric, you can generate a plot where the bubble-radius units match
the axis-scale units. To do so, specify the BUBBLEPLOT statement within
a LAYOUT OVERLAYEQUATED block, and in the BUBBLEPLOT statement, set
RELATIVESCALE=FALSE.
Note: Within a LAYOUT OVERLAY,
the unit-interval of the X and Y axes are not necessarily the same
and the bubbles might be distorted into ellipses when RELATIVESCALE=FALSE.
The OVERLAYEQUATED container ensures that the bubbles are displayed
as circles, assuming that both the X= and Y= arguments specify numeric
columns.
data influence;
input x y radius category;
datalines;
2 4 1 1
5 5 2 1
6 3 2 2
12 7 3 2
;
proc template;
define statgraph equatedbubbles;
begingraph;
entrytitle 'Radius of Influence';
entrytitle 'Bubbles Show Distance Covered by Observation';
layout overlayequated /
xaxisopts = (griddisplay=on)
yaxisopts = (griddisplay=on);
bubbleplot x=x y=y size=radius /
group=category datatransparency=0.5
relativescale=false ;
endlayout;
endgraph;
end;
proc sgrender data=influence template=equatedbubbles;
run;