Skip to contents

plot_spatial_verif is used to plot verification scores computed by functions from the harpSpatial package. This function uses it's own plotting options while allowing specific plot options (plot_opts) to be passed into a separate plotting function (such as plot_basic, plot_fss, plot_sal and plot_nact).

Usage

plot_spatial_verif(
  verif_data,
  score,
  filter_by = NULL,
  show_info = FALSE,
  plot_opts = list(),
  colour_theme = "bw",
  base_size = 11,
  base_family = "",
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  legend_position = "right",
  plot_caption = "auto",
  leadtimes_by = "hours",
  save_image = FALSE,
  ...
)

Arguments

verif_data

Output from spatial_verify. Expected to either be a dataframe or an SQLite file (needs path to file).

score

The score to plot. This will call the appropriate spatial plotting function through spatial_plot_func.

filter_by

Filter the data before plotting. Must be wrapped inside the vars function. This can be useful for making a single plot where there are many groups. For example, if the data contains various models the data can be filtered with e.g. filter_by = vars(det_model == "be13", fctime == 0).

show_info

Prints the contents of the score tables used as input before visualisation as well as plotting options (plot_opts) if any exist.

plot_opts

A list of plotting options that may be passed from outside into plotting functions that may use something specific while others might not be used.

colour_theme

The colour theme for the plot - can be any ggplot2 theme

base_size

base font size.

base_family

base font family.

base_line_size

base size for line elements.

base_rect_size

base size for rect elements.

legend_position

The position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector).

plot_caption

Caption for the plot. Set to "auto" to automatically generate the caption. Anything else inside quotes will be used as the plot caption.

leadtimes_by

Leadtimes in scores are by default expected to be in seconds but there is an option to view leadtimes as hours, minutes or seconds.

save_image

Saves the plot as a .png file without a preset path.

Value

A plot (interactive or saved image)

Examples

plot_spatial_verif(verif_data, 'SAL')
#> Error in eval(expr, envir, enclos): object 'verif_data' not found
plot_spatial_verif(verif_data, 'FSS')
#> Error in eval(expr, envir, enclos): object 'verif_data' not found
plot_spatial_verif(verif_data, 'NACT')
#> Error in eval(expr, envir, enclos): object 'verif_data' not found
plot_spatial_verif(verif_data, 'NACT', plot_opts = list(nact_scores = list("pod", "far"), colour_by = "scale"))
#> Error in eval(expr, envir, enclos): object 'verif_data' not found
plot_spatial_verif(verif_data, 'mse')
#> Error in eval(expr, envir, enclos): object 'verif_data' not found
plot_spatial_verif(verif_data, 'mae')
#> Error in eval(expr, envir, enclos): object 'verif_data' not found
plot_spatial_verif(verif_data, 'bias')
#> Error in eval(expr, envir, enclos): object 'verif_data' not found