Plot legend for proportional bars maps
legendBarsSymbols(pos = "topleft", title.txt = "Title of the legend",
title.cex = 0.8, cex = 1, values.cex = 0.6, var, r, breakval = NULL,
col = "red", col2 = "blue", frame = FALSE, values.rnd = 0,
style = "c")
Arguments
- pos
- position of the legend, one of "topleft", "top",
"topright", "left", "right", "bottomleft", "bottom", "bottomright".
- title.txt
- title of the legend.
- title.cex
- size of the legend title.
- cex
- size of the legend. 2 means two times bigger.
- values.cex
- size of the values in the legend.
- var
- vector of values.
- r
- a vector giving the heights of the bars.
- breakval
- breaking value (see Details).
- col
- color of symbols.
- col2
- second color of symbols (see Details).
- frame
- whether to add a frame to the legend (TRUE) or
not (FALSE).
- values.rnd
- number of decimal places of the values in
the legend.
- style
- either "c" or "e". The legend has two display
styles, "c" stands for compact and "e" for extended.
Details
The breakval parameter allows to plot symbols of two
colors: the first color (col) for values superior or equal to breakval,
second color (col2) for values inferior to breakval.
Examples
data("nuts2006")
plot(nuts0.spdf)
legendBarsSymbols(pos = "topleft", title.txt = "Title of\nthe legend",
title.cex = 0.8, values.cex = 0.6,cex = 3,
var = nuts1.df$pop2008,
r = sqrt((abs(nuts1.df$pop2008) * 100000) / pi),
col = "purple",
values.rnd=0, style ="e")
