tmap_style | R Documentation |
Set or get the default tmap style. Without arguments, the current style is returned. Also the available styles are displayed. When a style is set, the corresponding tmap options (see tmap_options
) will be set accordingly. The default style (i.e. when loading the package) is "white"
.
tmap_style(style)
style |
name of the style. When omitted, |
Note that tm_style
is used within a plot call (so it only affects that plot), whereas tmap_style
sets the style globally.
After loading a style, the options that defined this style (i.e. the difference with the default "white"
style) can be obtained by tmap_options_diff
.
The documentation of tmap_options
(details and the examples) shows how a new style is created.
the style before changing
tmap_options
for tmap options, and tmap_style_catalogue
to create a style catalogue of all available styles.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.