Plots a map figure in the same format as would be given by map_ereefs(), but using a pre-generated dataframe, instead of processing data directly from ereefs netcdf files. Doesn't work for true_color maps.

plot_map(
  datapoly,
  var_longname = "",
  var_units = "",
  Land_map = FALSE,
  scale_col = c("ivory", "coral4"),
  scale_lim = c(NA, NA),
  box_bounds = c(NA, NA, NA, NA),
  label_towns = TRUE,
  zoom = 6,
  p = NA,
  suppress_print = TRUE,
  gbr_poly = FALSE
)

Arguments

datapoly

A dataframe in the format required by geom_plot(), as provided by map_ereefs() or map_ereefs_movie().

var_longname

Character vector to use for the figure title.

var_units

Units to include in the figure labelling.

Land_map

Set to TRUE to show a land mapof Queensland. Default now FALSE.

scale_col

Vector of colours to use for the colour scale. This can be colours from the ggplot colour palette or a RGB hash code, or "spectral". Ignored for true_colour plots. If set to "spectral", uses a colour spectrum from bluish to red (similar to jet but less vivid). Otherwise: If one value is given (other than "spectral"), low colour is set to ivory and high colour to the value given. If two values are given, these are used as low and high limit colours. If three values are given, the middle value is used to set the mid-point of the scale. Defaults to c('ivory', 'coral4').

scale_lim

Upper and lower bounds for colour scale. Defaults to full range of data. Ignored for true_colour plots.

p

Handle for an existing figure if you want to add a layer instead of creating a new figure. If p is provided, Land_map is over-ridden and set to FALSE.

suppress_print

Set to TRUE if you don't want the plots generated and saved. Defaults to TRUE.

Value

p Handle for the figure generated.

Examples

if (FALSE) {
a <- plot_map(p)
plot_map(a[[2]])
}