Skip to contents

Builds faceted scatterplots from validate_flow_residuals() data. The default comparison is adjusted versus benchmark, with colour showing the signed difference between the second and first named series. For a single comparison, axis labels name the selected X and Y series directly; for multiple comparisons, facet headers include the compared series.

Usage

plot_validation_scatter(
  residuals,
  comparisons = "adjusted_vs_benchmark",
  methods = NULL,
  method_col = "method",
  method_labels = NULL,
  difference_limits = NULL,
  difference_quantile = 0.95,
  white_band = 0.22,
  point_alpha = 0.45,
  point_size = 1.1,
  point_outline = TRUE,
  point_outline_colour = "#6B7280",
  point_stroke = 0.12
)

plot_validate_flow_scatter(...)

Arguments

residuals

A data frame, one validate_flow_residuals() result, or a named list of validate_flow_residuals() results.

comparisons

Comparisons to plot. Defaults to "adjusted_vs_benchmark". Use a character vector to compare multiple flow-pair definitions. When "raw_vs_benchmark" is included, it is shown once as the unadjusted raw MPD baseline.

methods

Optional character vector of method identifiers or display labels to include. Default NULL includes all methods.

method_col

Column containing the method identifier. Default "method".

method_labels

Optional named character vector used to relabel methods.

difference_limits

Optional numeric vector of length 2 giving the colour-scale limits for the signed difference. Values outside the limits are squished to the end colours.

difference_quantile

Quantile of absolute signed differences used for robust symmetric colour limits when difference_limits = NULL. Set to 1 to use the full observed range. Default 0.95.

white_band

Width of the neutral white band around zero as a proportion of the colour scale. Increase this to make near-zero differences read as neutral. Default 0.22.

point_alpha

Point opacity. Default 0.45.

point_size

Point size. Default 1.1.

point_outline

Logical; draw points as filled circles with a subtle neutral outline. Default TRUE.

point_outline_colour

Outline colour used when point_outline = TRUE. Default "#6B7280".

point_stroke

Outline stroke width used when point_outline = TRUE. Default 0.12.

Value

A ggplot object.