Learn R Programming

GISTools (version 1.0-1)

thematic.map: thematic.map

Description

Draw thematic maps together with histograms with a Spatial or sf object, background layers according to variables and shading schemes.

Usage

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,...)

Value

None (see above).

Arguments

data

A Spatial or sf object.

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. rainbow, heat.colors, hcl.colors, terrain.colors and colors

na.pos

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

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

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

Author

Binbin Lu

Details

The function returns no value, but draws thematic maps together with histograms on the current graphics device as a side effect.

See Also

choropleth, choro.legend, auto.shading, shading.

Examples

Run this code
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"))

Run the code above in your browser using DataLab