From 7686aeffe5077c3e52070ef912d39e33e5d2d9a5 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Fri, 4 Mar 2022 11:32:46 +0100 Subject: [PATCH] Fill water in x plot --- swash/processing/post.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/swash/processing/post.py b/swash/processing/post.py index d4dfd97..4ad36b1 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -75,11 +75,14 @@ ax_r.grid() fig_x, ax_x = plt.subplots() ax_x.plot(data["x"], -data["botl"], color="k") -ax_x.plot(data["x"], np.maximum(data["watl"][arg_t0, :], -data["botl"])) +ax_x.fill_between( + data["x"], + -data["botl"], + np.maximum(data["watl"][arg_t0, :], -data["botl"]), +) ax_x.axvline(x0, c="k", alpha=0.2) ax_x.set(xlabel="x (m)", ylabel="z (m)") ax_x.autoscale(axis="x", tight=True) -ax_x.grid() out = pathlib.Path(config.get("post", "out")).joinpath(f"t{t0}x{x0}") log.info(f"Saving plots in '{out}'")