View source: R/tm_layers_circles.R
| tm_circles | R Documentation |
Map layer that draws circles with geographically fixed radii — i.e. the
radius is expressed in meters and the circles scale with zoom in interactive
(view) mode. This is in contrast to tm_bubbles(), where the symbol size
is a fixed number of screen pixels.
tm_circles(
size = tm_const(),
size.scale = tm_scale(),
size.legend = tm_legend(),
size.chart = tm_chart_none(),
size.free = NA,
fill = tm_const(),
fill.scale = tm_scale(),
fill.legend = tm_legend(),
fill.chart = tm_chart_none(),
fill.free = NA,
col = tm_const(),
col.scale = tm_scale(),
col.legend = tm_legend(),
col.chart = tm_chart_none(),
col.free = NA,
lwd = tm_const(),
lwd.scale = tm_scale(),
lwd.legend = tm_legend(),
lwd.chart = tm_chart_none(),
lwd.free = NA,
lty = tm_const(),
lty.scale = tm_scale(),
lty.legend = tm_legend(),
lty.chart = tm_chart_none(),
lty.free = NA,
fill_alpha = tm_const(),
fill_alpha.scale = tm_scale(),
fill_alpha.legend = tm_legend(),
fill_alpha.chart = tm_chart_none(),
fill_alpha.free = NA,
col_alpha = tm_const(),
col_alpha.scale = tm_scale(),
col_alpha.legend = tm_legend(),
col_alpha.chart = tm_chart_none(),
col_alpha.free = NA,
plot.order = tm_plot_order("size"),
zindex = NA,
group = NA,
group.control = "check",
popup = tm_popup(),
popup.vars = NA,
popup.format = tm_label_format(),
hover = NA,
id = "",
blend = "over",
options = opt_tm_circles(),
...
)
opt_tm_circles(
points_only = "ifany",
point_per = "feature",
on_surface = FALSE
)
size, size.scale, size.legend, size.chart, size.free |
Map variable that determines the size. See details. Unit: Meters. Accepts a plain numeric vector (values already in meters) or a |
fill, fill.scale, fill.legend, fill.chart, fill.free |
Map variable that determines the fill color. See details. Unit: Color – a color name, hex string. |
col, col.scale, col.legend, col.chart, col.free |
Map variable that determines the color. See details. Unit: Color – a color name, hex string. |
lwd, lwd.scale, lwd.legend, lwd.chart, lwd.free |
Map variable that determines the line width. See details. Unit: Base R line-width units; 1 lwd is approx. 0.75 pt at 96 dpi. |
lty, lty.scale, lty.legend, lty.chart, lty.free |
Map variable that determines the line type. See details. Unit: Integer (1-6) or name: "solid", "dashed", "dotted", "dotdash", "longdash", "twodash". |
fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.chart, fill_alpha.free |
Map variable that determines the fill color transparency. See details. Unit: Proportion – numeric 0-1 (0 = fully transparent, 1 = fully opaque). |
col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.chart, col_alpha.free |
Map variable that determines the color transparency. See details. Unit: Proportion – numeric 0-1 (0 = fully transparent, 1 = fully opaque). |
plot.order |
Specification in which order the spatial features are
drawn. See |
zindex |
Controls the stacking order of map layers. Should be set to a value above 400. By default, layers are stacked in call order, starting at 401. See details. |
group |
Name of the group to which this layer belongs. This is only
relevant in view mode, where layer groups can be switched (see |
group.control |
In view mode, the group control determines how layer groups
can be switched on and off. Options: |
popup |
popup specification for |
popup.vars |
(Deprecated.) Use |
popup.format |
(Deprecated.) Use |
hover |
name of the data variable that specifies the hover labels (view mode only). Set to |
id |
name of the data variable that specifies the indices of the spatial
features. Only used for |
blend |
Compositing operator for layer blending. Default |
options |
Options passed on to |
... |
To catch deprecated arguments from version < 4.0. |
points_only |
Should only point geometries of the shape object be
plotted? Default |
point_per |
How spatial points are generated for non-point geometries.
One of |
on_surface |
For polygon inputs, should the centroid be guaranteed to
lie on the surface? If |
Supported map variables: fill (fill color), col (border color),
size (radius in meters), lwd (line width), lty (line type),
fill_alpha (fill transparency), col_alpha (border transparency).
tm_bubbles() for screen-fixed proportional circles (pixel radius).
tm_symbols() for the general symbol layer with configurable shapes.
tm_scale_asis() to pass data values directly as metre radii.
## Three concentric layers of geographic circles at different administrative
## levels, each with a fixed radius that corresponds to a real-world distance.
## Because the radius is in meters the circles scale with zoom in view mode.
tm_shape(NLD_prov) +
tm_circles(size = 5000, fill = "#0033ff", col = NULL) +
tm_shape(NLD_muni) +
tm_circles(size = 2000, fill = "#99dd99", col = NULL) +
tm_shape(NLD_dist) +
tm_circles(size = 1000, fill = "#ff8833", col = NULL)
## Use a units object — any linear unit is accepted and converted to meters
NLD_prov$one_mile <- units::as_units(1:12, "mi")
tm_shape(NLD_prov) +
tm_circles(size = "one_mile", size.scale = tm_scale_asis())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.