Skip to contents

This function produces a plot comparing modelled and measured concentrations. For long-term data, a traditional scatter plot of observed vs modelled concentrations is plotted with a shaded area showing the acceptability range and dashed boundaries showing the maximum accepted measurement uncertainty. For short-term data, a 'bullseye' scatter plot is plotted showing two complementary performance indicators with a shaded area showing the MQO fulfilment area and a dashed boundary showing the maximum accepted measurement uncertainty.

Usage

plot_mqi_scatter(
  stats_shortterm = NULL,
  stats_longterm = NULL,
  show_dashed = FALSE,
  color_fixed = "#4269D0",
  color_indicative = "#EFB118",
  color_outline = "black",
  interactive = FALSE,
  gp = grid::gpar(fontsize = 10)
)

Arguments

stats_shortterm, stats_longterm

The output of summarise_mqo_stats(). All relevant information (e.g., term, params_fixed, etc.) will be passed to this function. stats_shortterm should contain short-term (temporal) statistics, stats_longterm should contain long-term (spatial) statistics. Either of these can be NULL, but at least one should be provided.

show_dashed

Should extra dashed lines be shown on the figures? These show the maximum accepted measurement uncertainty, but can overcrowd the plotting area.

color_fixed, color_indicative, color_outline

The colours to use for fixed data, indicative data, and any another annotations. Can be expressed as hex codes, or any colours listed in colors().

interactive

If FALSE, the default, a static ggplot2 graphic will be returned which can be saved as a PNG, SVG, or other similar format. If TRUE, a dynamic HTML widget will be returned created by plotly.

gp

A grid::gpar() object passed to grid::textGrob(), used to control the appearance of the parameter & indicator annotations. fontsize is likely the most useful argument, but many options are available through grid::gpar(). Only applies when interactive = FALSE.

See also

Author

Jack Davison

Examples

long <- summarise_mqo_stats(demo_longterm, pollutant = "PM10")
#> ! term assumed to be 'long'.
#>  If this is incorrect, please specify the data's term using the term argument.

short <- summarise_mqo_stats(demo_shortterm, pollutant = "PM10")
#> ! term assumed to be 'short'.
#>  If this is incorrect, please specify the data's term using the term argument.

plot_mqi_scatter(stats_shortterm = short)


plot_mqi_scatter(stats_shortterm = short, stats_longterm = long)


plot_mqi_scatter(stats_longterm = long)