ShowGof

Render a compact multiline block of GoF metrics at a chosen position on an axis. Metrics are computed internally via gof and can be filtered via the metrics keyword.

Examples

yobs = [1, 2, 3, 4, 5]
ysim = [1, 2, 3, 4, 6]


fig = Figure(; size=(700, 350))

ax = Axis(
  fig[1, 1], titlefont = :regular,
  xlabel = "Yobs (-)", ylabel = "Ysim (-)"
)
scatter!(ax, yobs, ysim; markersize=10, color=:black)
lines!(ax, [0, 6], [0, 6]; color=:red, linestyle=:dash, linewidth=2)
show_gof!(
  ax, 5.3, 0.1,
  yobs, ysim;
  metrics = ["R2", "RMSE"],
  n=2,
  align=(:right, :bottom),
  color=:red
)
fig
Example block output

APIs

Junimo.show_gof!Function
show_gof!(ax, x, y, obs, sim; metrics=nothing, n=nothing, align=(:right, :bottom), color=:black)

Render GoF metrics at a given position on an existing axis. The metrics are computed internally via gof(obs, sim) and then formatted as multiline text.

Arguments

  • ax: Makie axis to draw on
  • x, y: Text position coordinates
  • obs, sim: Observed and simulated values (scalars or sequences)

Keywords

  • metrics: List of metric keys to display (e.g. ["R2", "NSE"]). If nothing, defaults to ["R2", "NSE", "KGE", "RMSE", "bias"].
  • n: Decimal digits to round to; forwarded to gof(...; n_small=n).
  • align: Text alignment tuple passed to text!.
  • color: Text color passed to text!.

Notes

  • Unknown metric keys are shown as NaN.
source