| plot_map | R Documentation |
An sf object with polygons gives a choropleth. A data frame with
latitude and longitude gives one square for each grid point.
plot_map(
data,
column,
boundaries = NULL,
facet = NULL,
log = FALSE,
months = FALSE,
labels = NULL,
cmap = "viridis",
center = NULL,
title = NULL,
legend_title = NULL
)
data |
sf object with polygons, or data frame with latitude and longitude |
column |
Column to colour by. A vector gives one panel per column, with one shared colour scale. |
boundaries |
Optional sf polygons to draw as outlines on top |
facet |
Optional column. One panel per value (for example a period). |
log |
Use a log colour scale (values must be positive) |
months |
The values are months (1-12). Use 12 discrete colours and
month names in the legend, for example for |
labels |
Optional column to write at each polygon centre |
cmap |
Viridis option name ( |
center |
Centre a diverging palette on this value, with limits the
same distance on each side (for example 0 for a bias). Use it with a
diverging |
title |
Plot title |
legend_title |
Legend title. The default is the column name. |
ggplot object
grid <- expand.grid(latitude = seq(10, 12, 0.5), longitude = seq(70, 72, 0.5))
grid$t2m <- grid$latitude + grid$longitude
plot_map(grid, "t2m")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.