Plots raster data in equal earth projection.

plot_map_eqearth(
  dat,
  ext = as.vector(terra::ext(dat)),
  zlim = range(terra::values(dat), na.rm = TRUE),
  col = viridis::viridis(20),
  brks.pos = c(0, 1),
  brks.lab = brks.pos,
  npoints = 15,
  nlines = 9,
  title = "",
  colour_scale = TRUE,
  top_layer = NA,
  top_layer.col = "ghostwhite",
  site_xy = NA,
  dim = NA
)

Arguments

dat

The raster data to plot.

ext

The extent to use to plot the data. (default is extent of dat)

zlim

The range of the values to plot. (default is estimated from dat)

col

The color gradient to use. (default is viridis)

brks.pos

The position where to draw tick marks on the legend

brks.lab

The labels to add where the tickmarks are draw (default is tickmarks position)

npoints

The number of points used to draw the polygons and lines along each dimension. (default is 15 for a smooth result)

nlines

The number of coordinate lines to add in the background (default is 9)

title

A description title (default is empty).

colour_scale

A boolean to add the colour scale to the plot (default TRUE).

top_layer

A raster to overlay on top of the map (e.g. a distribution).

top_layer.col

A colour for plotting top_layer (default 'ghostwhite').

site_xy

Coordinates of a location to add to the plot.

dim

The dimension of the plotting window in inches (default dev.size()).

Value

The set of coordinates ext projected in equal earth.