Graphics Reference
In-Depth Information
Figure 5-35. Balloon plot with categorical axes and text labels
In this example we've used a few tricks to add the text labels under the circles. First, we used
vjust=1
to top-justify the text to the ycoordinate. Next, we wanted to set the ycoordinate so
that it is just underneath the bottom of each circle. This requires a little arithmetic: take the nu-
mericvalue of
Hair
and subtract a small value from it, where the value depends in some way
on
count
. This actually requires taking the square root of
count
, since the radius has a linear
relationship with the square root of
count
. The number that this value divided by (22 in this
case) is found by trial and error; it depends on the particular data values, radius, and text size.