tmap (version 1.11)

tmap_style: Set the default tmap style

Description

Set the default tmap style, which is contained in the global option tmap.style (see also tmap_options. The default style (i.e. when loading the package) is "white".

Usage

tmap_style(style)

Arguments

style

name of the style. The function tm_style_<style> should exist and be a wrapper of tm_layout. The default style when loading the package is "white", which corresponds to the function tm_style_white. See tm_layout for predefined styles, and style_catalogue for creating a catelogue.

Value

the style before changing

See Also

tm_layout for predefined styles, style_catalogue to create a style catelogue of all available styles, and tmap_options for tmap options.

tmap_options for tmap options

Examples

Run this code
# NOT RUN {
data(World)

current.style <- tmap_style("classic")
qtm(World, fill="life_exp", fill.title="Life expectancy")

tmap_style("cobalt")
qtm(World, fill="life_exp", fill.title="Life expectancy")

# restore current style
tmap_style(current.style)
# }

Run the code above in your browser using DataLab