powered by
plot_swatch maps discretized values of a quantity using continuous color gradients.
plot_swatch
plot_swatch( x, values = NULL, col = hcl.colors(n = 10, palette = "Blue-Red 3", rev = FALSE), key_label = "", leg = 10, lwd = 15, pos = "bottomleft", legend = TRUE, border = par("fg"), breaks = "quantile", min = NULL, max = NULL, ... )
Returns no value, just map swatch of colors in geographic space!
A data frame or object of the class SpatialPolygonsDataFrame
Variable in the SpatialPolygonsDataFrame for which to discretize the values of the quantity.
A vector of colors
label for the color key
Numeric, length of the legend
numeric, line width of the legend.
location to position the legend such as “bottomright”, “bottomleft”, “topleft”, and “topright”.
logical indicating whether to add a legend to the map.
plot polygons in SpatialPolygons object
one of “equal”, “pretty”, “jenks”, “quantile” or numeric with the actual breaks by specifying the minimum (min) and maximum (max) bounds.
min
max
the minima of the lowest bound of the break.
the maxima of the upper bound of the break
Further arguments passed to or from other methods.
Barnabas H. Daru darunabas@gmail.com
SpatialPolygons-class
library(sp) s <- readRDS(system.file("nigeria/SR_Naija.rds", package = "phyloregion")) plot_swatch(s, values = s$SR)
Run the code above in your browser using DataLab