tmap_style {tmap} | R Documentation |
Set or get the default tmap style
Description
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"
.
Usage
tmap_style(style)
Arguments
style |
Name of the style. When omitted, |
Details
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 to create a new style.
Value
The style before changing
See Also
-
tmap_options()
for tmap options -
tmap_style_catalogue()
to create a style catalogue of all available styles.
Examples
tmap_style()
tm_shape(World) + tm_polygons("HPI")
tmap_style("cobalt")
tm_shape(World) + tm_polygons("HPI")
# for backwards compatibility, the styles of tmap versions 1-3 are also included:
tmap_style("v3")
tm_shape(World) + tm_polygons("HPI")
tmap_style("cobalt_v3")
tm_shape(World) + tm_polygons("HPI")