Skip to content

Commit 3d532af

Browse files
Update plotting
1 parent 9b41879 commit 3d532af

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

src/plotting.jl

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ function quickplot(node::NetworkNode, climate::Climate)
2121

2222
return fig
2323
end
24-
25-
2624
function quickplot(obs, node::NetworkNode, climate::Climate, label="", log=false; burn_in=1, limit=nothing, metric=Streamfall.mKGE)
2725
return quickplot(obs, node.outflow, climate, label, log; burn_in=burn_in, limit=limit, metric=metric)
2826
end
29-
3027
function quickplot(obs::DataFrame, sim::Vector, climate::Climate, label="", log=false; burn_in=1, limit=nothing, metric=Streamfall.mKGE)
3128
return quickplot(Matrix(obs[:, Not("Date")])[:, 1], sim, climate, label, log; burn_in, limit, metric)
3229
end
@@ -36,8 +33,6 @@ function quickplot(obs::Vector, sim::Vector, climate::Climate, label="", log=fal
3633
show_range = burn_in:last_e
3734
return quickplot(obs[show_range], sim[show_range], date[show_range], label, log; metric=metric)
3835
end
39-
40-
4136
function quickplot(obs::Vector, sim::Vector, xticklabels::Vector, label="Modeled", log=false; metric=Streamfall.mKGE)
4237
@assert length(xticklabels) == length(obs) || "x-axis tick label length and observed lengths do not match!"
4338
@assert length(xticklabels) == length(sim) || "x-axis tick label length and simulated lengths do not match!"
@@ -52,28 +47,34 @@ function quickplot(obs::Vector, sim::Vector, xticklabels::Vector, label="Modeled
5247
end
5348

5449
label = "$(label) ($(metric_name): $(score))"
55-
fig = plot(xticklabels, obs,
56-
label="Observed",
57-
legend=:best,
58-
ylabel="Streamflow",
59-
xlabel="Date",
60-
fg_legend=:transparent,
61-
bg_legend=:transparent)
62-
plot!(xticklabels, sim, label=label, alpha=0.7)
50+
fig = plot(
51+
xticklabels, obs,
52+
label="Observed",
53+
legend=:best,
54+
ylabel="Streamflow",
55+
xlabel="Date",
56+
fg_legend=:transparent,
57+
bg_legend=:transparent
58+
)
59+
plot!(xticklabels, sim, label=label, alpha=0.5)
6360

6461
if log
6562
# modify yaxis
6663
yaxis!(fig, :log10)
6764
end
6865

69-
qqfig = qqplot(obs, sim, legend=false, markerstrokewidth=0, alpha=0.7, xlabel="Observed", ylabel="Modeled")
66+
qqfig = qqplot(
67+
obs, sim,
68+
legend=false, markerstrokewidth=0.03, markerstrokealpha=0.1, markeralpha=0.2,
69+
xlabel="Observed", ylabel="Modeled"
70+
)
7071

7172
if log
7273
xaxis!(qqfig, :log10)
7374
yaxis!(qqfig, :log10)
7475
end
7576

76-
combined = plot(fig, qqfig, size=(1000, 500), left_margin=5mm, bottom_margin=5mm, layout=(1,2))
77+
combined = plot(fig, qqfig, size=(1000, 500), left_margin=10mm, bottom_margin=5mm, layout=(1,2))
7778

7879
return combined
7980
end

0 commit comments

Comments
 (0)