From 2a2793f92e01ba028d65a776aa19a057cdc1ec51 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 3 Mar 2022 16:12:19 +0100 Subject: [PATCH] Fixed t plot in post --- swash/processing/post.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swash/processing/post.py b/swash/processing/post.py index 502d0f4..1638aef 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -76,7 +76,7 @@ ax_r.grid() fig_x, ax_x = plt.subplots() ax_x.plot(-data["botl"], color="k") -ax_x.plot(data["dep"][t == t0, :] - data["botl"]) +ax_x.plot(data["dep"][np.argmin(np.abs(t - 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)