A lower-level plotting helper that turns a polygon/value table, or the list returned by `map_ereefs(..., return_poly = TRUE)`, into a `ggplot2` map.

plot_map(
  datapoly,
  var_longname = "",
  var_units = "",
  Land_map = FALSE,
  scale_col = "viridis",
  scale_lim = c(NA, NA),
  plot_style = c("polygon", "smooth"),
  smooth_pixels = 600,
  box_bounds = c(NA, NA, NA, NA),
  label_towns = TRUE,
  zoom = 6,
  p = NA,
  suppress_print = TRUE,
  gbr_poly = FALSE
)

Arguments

datapoly

Polygon/value table in the format used internally by the package, or a list returned by `map_ereefs(..., return_poly = TRUE)`.

var_longname

Optional long name for the plot title.

var_units

Optional units label.

Land_map

Logical; add a simple land underlay where available.

scale_col

Colour scale specification. Defaults to `"viridis"` for scalar maps.

scale_lim

Numeric colour limits. If left as `NA`, limits are inferred from the data.

plot_style

Either `"polygon"` or `"smooth"`.

smooth_pixels

Resolution used for `"smooth"` display maps.

box_bounds

Optional bounds in the form `c(longitude_min, longitude_max, latitude_min, latitude_max)`.

label_towns

Logical; add town labels where available.

zoom

Deprecated legacy argument retained for backward compatibility.

p

Optional existing plot object to add to.

suppress_print

Logical; if `TRUE`, suppresses automatic printing.

gbr_poly

Logical; add GBR polygon overlay when available.

Value

A `ggplot2` object.