Plot a scatter chart visualising the Modelling Quality Indicator (MQI)
plot_mqi_scatter.RdThis 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,
stats2 = NULL,
show_dashed = FALSE,
show_annotations = TRUE,
color_fixed = "#4269D0",
color_indicative = "#EFB118",
color_outline = "black",
censor = 2,
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.statsis compulsory andstats2optional. If both are provided,statsandstats2should 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 ifshow_annotations = TRUE.- show_dashed
Should extra dashed lines be shown on the figures? These show the maximum accepted measurement uncertainty, but can overcrowd the plotting area.
- 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.
- 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().- censor
For short-term data (the bullseye chart), the maximum value to extend axes to. The default,
2, extends the x- and y-axes from-2to2, with any values greater than2constrained to2and any values less than-2constrained to-2. IfNULL, the plot will extend to the full range of values.- interactive
If
FALSE, the default, a staticggplot2graphic will be returned which can be saved as a PNG, SVG, or other similar format. IfTRUE, a dynamic HTML widget will be returned created byplotly.- gp
A
grid::gpar()object passed togrid::textGrob(), used to control the appearance of the parameter & indicator annotations whenshow_annotations = TRUE.fontsizeis likely the most useful argument, but many options are available throughgrid::gpar(). Only thefontsizeargument is used wheninteractive = TRUE.
See also
Other plotting functions:
plot_comparison_bars(),
plot_mqi_bars(),
plot_mqi_report(),
plot_timeseries()
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.
#>
#> ! Using fixed long-term annual pm10 parameters.
#> ℹ If this is incorrect, please use `mqor::mqo_params()` or
#> `mqor::mqo_params_default()` to construct a parameter set.
#>
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.
#>
#> ! Using fixed short-term daily pm10 parameters.
#> ℹ If this is incorrect, please use `mqor::mqo_params()` or
#> `mqor::mqo_params_default()` to construct a parameter set.
#>
plot_mqi_scatter(short, interactive = TRUE)
plot_mqi_scatter(short, long, interactive = TRUE)
plot_mqi_scatter(long, interactive = TRUE)