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
APIs
Junimo.show_gof! — Function
show_gof!(ax, x, y, obs, sim; metrics=nothing, n=nothing, align=(:right, :bottom), color=:black)Render GoF metrics as multiline text at a given position on an existing axis.
Inputs
- ax: Makie axis to draw on
- x, y: text position coordinates
- obs: observed values
- sim: simulated values
- metrics: list of metric keys to display; 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
- Metrics are computed via
gof(obs, sim)and formatted as multiline text.