BubbleLegend.Rd
Add a legend for bubbles to a bubble plot.
BubbleLegend(x, y = NULL, area, cols, labels = NULL, cols.lbl = "black",
width = NULL, xjust = 0, yjust = 1, inset = 0, border = "black",
frame = TRUE, adj = c(0.5, 0.5), cex = 1, cex.names = 1,
bg = NULL, ...)
the left x-coordinate to be used to position the legend. See 'Details'.
the top y-coordinate to be used to position the legend. See 'Details'.
the area(s) for the bubbles in bubble legend.
the color appearing in the legend.
a vector of labels to be placed at the right side of the legend.
the textcolor for the labels of the bubbles.
the width of the legend.
how the legend is to be justified relative to the legend x location. A value of 0 means left justified, 0.5 means centered and 1 means right justified.
the same as xjust
for the legend y location.
inset distance(s) from the margins as a fraction of the plot region when legend is placed by keyword.
defines the bordor color of each rectangle. Default is none (NA
).
defines the bordor color of the frame around the whole legend. Default is none (NA
).
text alignment, horizontal and vertical.
extension factor for the area, default 1.0.
character extension for the labels, default 1.0.
the background color for the bubble legend.
further arguments are passed to the function text
.
The labels are placed in the middle of the legend.
The location of the legend may be specified by setting x to a single keyword from the list "bottomright"
, "bottom"
, "bottomleft"
, "left"
, "topleft"
, "top"
, "topright"
, "right"
and "center"
. This places the legend on the inside of the plot frame at the given location. Partial argument matching is used. The optional inset argument specifies how far the legend is inset from the plot margins. If a single value is given, it is used for both margins; if two values are given, the first is used for x- distance, the second for y-distance. This is the same behaviour as it's implemented in legend
.
PlotBubble(x=d.pizza$delivery_min, y=d.pizza$temperature, area=d.pizza$price,
xlab="delivery time", ylab="temperature",
col=SetAlpha(as.numeric(d.pizza$area)+2, .5), border="darkgrey",
na.rm=TRUE, main="Price-Bubbles", panel.first=grid())
BubbleLegend("bottomleft", area=c(1500, 1000, 500), frame=TRUE,
cols=SetAlpha("steelblue",0.5), bg="green",
labels=c(1500, 1000, 500), cex=0.8,
cols.lbl=c("yellow", "red","blue"))