Bubble plot based on function vaguely based on bubble
by Edzer
Pebesma in gstat package. By default, positive values have closed bubbles
and negative values have open bubbles.
bubble3(
x,
y,
z,
col = 1,
cexZ1 = 5,
maxsize = NULL,
do.sqrt = TRUE,
bg.open = gray(0.95, 0.3),
legend = TRUE,
legendloc = "top",
legend.z = "default",
legend.yadj = 1.1,
main = "",
cex.main = 1,
xlab = "",
ylab = "",
minnbubble = 3,
xlim = NULL,
ylim = NULL,
axis1 = TRUE,
xlimextra = 1,
add = FALSE,
las = 1,
allopen = TRUE
)
Vector of x-values.
Vector of y-values.
Vector of bubble sizes, where positive sizes will be plotted as
closed bubbles and negative as open unless allopen==TRUE
.
Color for bubbles. Should be either a single value or vector of length equal to x, y, and z vectors.
Character expansion (cex) value for a proportion of 1.0.
Size of largest bubble. Preferred option is now an expansion
factor for a bubble with z=1 (see cexZ1
above).
Should size be based on the area? (Diameter proportional to sqrt(z)). Default=TRUE.
background color for open bubbles (border will equal 'col')
Add a legend to the plot?
Location for legend (default='top')
If a legend is added, what z values will be shown. Default is c(-3,-2,-1,.1,1,2,3) for Pearson-like quantities and a smaller range for proportions that are all less than 1.
If a legend is added, how much should the y-axis be expanded to make space for it.
Title of plot. Default="".
Character expansion for title. Default=1.
X-axis label.
Y-axis label.
Minimum number of unique x values below which extra space is added to horizontal axis (to make plot look better). Default = 8.
Optional limits on x-range.
Optional limits on y-range.
Show the horizontal axis on plot? Option allows turning off for use in multi-figure plots.
Extra space (see minnbubble above). Default = 1.
Add bubbles to existing plot? Default=FALSE.
Style of axis labels (see ?par for more info).
Should all bubbles be open (instead of just negative values)?