tm_scale_rgb | R Documentation |
Scales in tmap are configured by the family of functions with prefix tm_scale
.
Such function should be used for the input of the .scale
arguments in the layer
functions (e.g. fill.scale
in tm_polygons()
).
The function tm_scale_rgb()
is used to transform r, g, b band variables to colors. This function is adopted from (and works similar as) stars::st_rgb()
tm_scale_rgb(
value.na = NA,
stretch = FALSE,
probs = c(0, 1),
max_color_value = 255L
)
tm_scale_rgba(
value.na = NA,
stretch = FALSE,
probs = c(0, 1),
max_color_value = 255
)
value.na |
value for missing values |
stretch |
should each (r, g, b) band be stretched? Possible values: |
probs |
probability (quantile) values when |
max_color_value |
maximum value |
tm_scale()
and stars::st_rgb()
## Not run:
require(stars)
file = system.file("tif/L7_ETMs.tif", package = "stars")
L7 = stars::read_stars(file)
tm_shape(L7) +
tm_rgb(col.scale = tm_scale_rgb(probs = c(0, .99), stretch = TRUE))
tm_shape(L7) +
tm_rgb(col.scale = tm_scale_rgb(stretch = "histogram"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.