Add information on animation
This commit is contained in:
parent
c08933a472
commit
57024e768e
1 changed files with 7 additions and 2 deletions
|
@ -30,7 +30,7 @@ def data(var):
|
|||
|
||||
|
||||
x = data("x")
|
||||
# t = data("t")
|
||||
t = data("t")
|
||||
|
||||
watl = data("watl")
|
||||
botl = data("botl")
|
||||
|
@ -40,6 +40,9 @@ wl = np.maximum(watl, -botl)
|
|||
|
||||
fig, ax = plt.subplots()
|
||||
ax.plot(x, -botl, c="k")
|
||||
ax.set(xlim=(x.min(), x.max()), ylim=(-30, 10), xlabel="x (m)", ylabel="z (m)")
|
||||
tit = ax.text(0.5, 0, f't={t[0]}', horizontalalignment='center', verticalalignment='bottom', transform=ax.transAxes)
|
||||
ax.grid()
|
||||
# ax.fill_between(
|
||||
# x, -botl, -data["botl"] + bathy.hstru, color="k", alpha=0.2
|
||||
# )
|
||||
|
@ -48,7 +51,9 @@ ax.plot(x, -botl, c="k")
|
|||
|
||||
def animate(i):
|
||||
line.set_ydata(wl[i])
|
||||
return (line,)
|
||||
tit.set_text(f"t={t[i]*1e-3:.2f}s")
|
||||
|
||||
return (line, tit)
|
||||
|
||||
|
||||
ani = animation.FuncAnimation(
|
||||
|
|
Loading…
Reference in a new issue