thematic.map | R Documentation |
Draw thematic maps together with histograms with a Spatial
or sf
object, background layers according to variables and shading schemes.
thematic.map(data, var.names, colorStyle = NULL, na.pos = "bottomright", bglyrs, bgStyle,
scaleBar.pos = "bottomright", mtitle = NULL, htitle = NULL,
legend = "Legend", legend.pos = "topright", cuts = 5,
cutter = quantileCuts, horiz = FALSE, digits=2,...)
data |
A |
var.names |
A vector of variable names to be mapped |
colorStyle |
A vector of colors (including "red", "blue" and "green") or a color function, e.g. |
na.pos |
A 2-D coordinate or character to define the position of north arrow, i.e. "topright", "topleft", "bottomright", "bottomleft" |
bglyrs |
A list of background layers of "Spatial" or "sf" objects |
bgStyle |
A list of parameters for define the styles of background layers, e.g. list(col="grey", cex=1, lwd=1, pch=16, lty=1) |
scaleBar.pos |
A 2-D coordinate or character to define the position of scale bar, i.e. "topright", "topleft", "bottomright", "bottomleft" |
mtitle |
Title of each map |
htitle |
Title of each histogram |
legend |
Title of each legend for each map |
legend.pos |
A 2-D coordinate or character to define the position of legend, i.e. "topright", "topleft", "bottomright", "bottomleft" |
cuts |
The number of classes. |
cutter |
Function used to create the break points. Can be user defined or a supplied cut function. |
horiz |
logical; if TRUE, set the legend horizontally rather than vertically |
digits |
Number of digits kept for legend |
... |
Arguments to be passed to methods |
The function returns no value, but draws thematic maps together with histograms on the current graphics device as a side effect.
None (see above).
Binbin Lu
choropleth
, choro.legend
, auto.shading
, shading
.
data(newhaven)
# Single map
thematic.map(blocks, var.names="POP1990", horiz = FALSE, na.pos = "topleft",
scaleBar.pos = "bottomright", legend.pos = "bottomleft",
colorStyle = "red")
#Multiple maps and different colors
thematic.map(blocks, var.names=c("P_35_44","P_25_34", "POP1990"),
horiz =FALSE, na.pos = "topleft", scaleBar.pos = "bottomright",
legend.pos = "bottomleft",colorStyle =hcl.colors)
thematic.map(blocks, var.names=c("P_35_44","P_25_34", "POP1990"),
horiz =FALSE, na.pos = "topleft", scaleBar.pos = "bottomright",
legend.pos = "bottomleft", colorStyle =c("red", "blue", "na"))
# Use coordinate to define the legend
data(WHData)
thematic.map(whp_sp, var.names="Avg_Green_", colorStyle ="red",
na.pos = "topleft", scaleBar.pos = "bottomleft",
legend.pos = c(544000, 3380000),cuts=7,
cutter=rangeCuts)
thematic.map(WHHP, var.names=c("Avg_HP_avg", "Avg_Green_"), colorStyle =c("red", "blue"),
na.pos = "topleft", scaleBar.pos = "bottomleft",
legend.pos = c(544000, 3380000),cuts=7,
cutter=rangeCuts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.