| geom_tissot | R Documentation |
This function adds Tissot's indicatrix to a map. Tissot's indicatrix is a mathematical contrivance used in cartography to characterize local distortions due to map projection.
geom_tissot(
mapping = ggplot2::aes(),
data = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
centres = c(5, 5),
radius = NULL,
fill = "red",
alpha = 0.7,
...
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are two options: A sf object or a SpatRaster object |
na.rm |
If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed. |
show.legend |
logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display. |
inherit.aes |
If FALSE, overrides the default aesthetics, rather than
combining with them. This is most useful for helper functions that define
both data and aesthetics and shouldn't inherit behaviour from the default
plot specification, e.g. |
centres |
Either a list with elements "lng" and "lat" giving the
longitudes and latitudes of the grid of centres for the Tissot's
indicatrix, or a vector of length 2 with the number of rows and columns to
generate such a grid automatically. The latter is passed to |
radius |
The radius of the circles (see |
fill |
The fill colour of the circles |
alpha |
The transparency of the circles |
... |
Other arguments passed on to |
A ggplot2 object
# load required packages
library(rnaturalearth)
library(sf)
library(ggplot2)
s_america_sf <- ne_countries(continent = "South America", returnclass = "sf")
s_am_equal_area <- suggest_crs(s_america_sf, distortion = "equal_area")
ggplot(data = s_america_sf) +
geom_sf() +
geom_tissot() +
coord_sf(crs = s_am_equal_area$proj4) +
theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.