Skip to contents

This function produces an ordered bar chart visualising the modelling quality indicator (MQI) for each site in the dataset. It also draws the 90th percentile of MQIs as a horizontal line; if this is below unity (1) the Modelling Quality Objective has been met. Unlike plot_comparison_bars(), both long-term and short-term MQIs/MQOs are visualised identically - although input params and calculated mqi and mqo values will differ.

Usage

plot_mqi_bars(
  stats,
  stats2 = NULL,
  color_bars = "grey85",
  color_outline = "black",
  show_annotations = FALSE,
  interactive = FALSE,
  gp = grid::gpar(fontsize = 10)
)

Arguments

stats, stats2

The output of summarise_mqo_stats(). All relevant information (e.g., term, params_fixed, etc.) will be passed to this function from the statistics object. stats is compulsory and stats2 optional. If both are provided, stats and stats2 should be different terms (one short and one long). In that case, short-term stats are plotted preferentially but the long-term stats will be annotated if show_annotations = TRUE.

color_bars, color_outline

The colours to use to fill the bars, and for the outlines/horizontal lines. Can be expressed as hex codes, or any colours listed in colors().

show_annotations

Should the figure be annotated with input parameters and complementary performance indicators? These are useful extra detail, but can overcrowd the plotting area.

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 when show_annotations = TRUE and interactive = FALSE. fontsize is likely the most useful argument, but many options are available through grid::gpar().

See also

Author

Jack Davison

Examples

plot_mqi_bars(
  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.


plot_mqi_bars(
  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.