Building block for drawing thematic maps. All element functions have the prefix tm_
.
The fundamental, and hence required element is tm_shape
, which specifies the shape object, and also specifies the projection and bounding box.
The elements that serve as aesthetics layers are
Base layers:
tm_polygons |
Create a polygon layer (with borders) |
tm_symbols |
Create a layer of symbols |
tm_lines |
Create a layer of lines |
tm_raster |
Create a raster layer |
tm_text |
Create a layer of text labels |
tm_basemap |
Create a layer of basemap tiles |
tm_tiles |
Create a layer of overlay tiles |
Derived layers:
tm_fill |
Create a polygon layer (without borders) |
tm_borders |
Create polygon borders |
tm_bubbles |
Create a layer of bubbles |
tm_squares |
Create a layer of squares |
tm_dots |
Create a layer of dots |
tm_markers |
Create a layer of markers |
tm_iso |
Create a layer of iso/contour lines |
tm_rgb |
Create a raster layer of an image |
The layers can be stacked by simply adding them with the + symbol. The combination of the elements described above form one group. Multiple groups can be stacked. Each group should start with tm_shape
.
Attributes layers:
tm_grid |
Create grid lines |
tm_scale_bar |
Create a scale bar |
tm_compass |
Create a map compass |
tm_credits |
Create a text for credits |
tm_logo |
Create a logo |
tm_xlab and tm_ylab |
Create axis labels |
tm_minimap |
Create a minimap (view mode only) |
Layout element:
tm_layout |
Adjust the layout (main function) |
tm_legend |
Adjust the legend |
tm_view |
Configure the interactive view mode |
tm_style |
Apply a predefined style |
tm_format |
Apply a predefined format |
--------------------------- | --------------------------------------------------------------------------------------------------- |
Tennekes, M., 2018, tmap: Thematic Maps in R, Journal of Statistical Software, 84(6), 1-39, DOI
The examples in each of the element functions