Results: CustomPlot: Use automatic x and y lim.

setup.py
Pierre-Antoine Rouby 2024-05-03 14:40:20 +02:00
parent a0cdb182fd
commit ba81f923d9
1 changed files with 26 additions and 26 deletions

View File

@ -77,9 +77,9 @@ class CustomPlot(PamhyrPlot):
kp = reach.geometry.get_kp()
z_min = reach.geometry.get_z_min()
self.canvas.axes.set_xlim(
left=min(kp), right=max(kp)
)
# self.canvas.axes.set_xlim(
# left=min(kp), right=max(kp)
# )
meter_axes = self.canvas.axes
m3S_axes = self.canvas.axes
@ -88,10 +88,10 @@ class CustomPlot(PamhyrPlot):
lines = {}
if "elevation" in self._y:
meter_axes.set_ylim(
bottom=min(0, min(z_min)),
top=max(z_min) + 1
)
# meter_axes.set_ylim(
# bottom=min(0, min(z_min)),
# top=max(z_min) + 1
# )
line = meter_axes.plot(
kp, z_min,
@ -108,10 +108,10 @@ class CustomPlot(PamhyrPlot):
)
)
meter_axes.set_ylim(
bottom=min(0, min(z_min)),
top=max(water_z) + 1
)
# meter_axes.set_ylim(
# bottom=min(0, min(z_min)),
# top=max(water_z) + 1
# )
line = meter_axes.plot(
kp, water_z, lw=1.,
@ -133,10 +133,10 @@ class CustomPlot(PamhyrPlot):
)
)
m3s_axes.set_ylim(
bottom=min(0, min(q)),
top=max(q) + 1
)
# m3s_axes.set_ylim(
# bottom=min(0, min(q)),
# top=max(q) + 1
# )
line = m3s_axes.plot(
kp, q, lw=1.,
@ -206,9 +206,9 @@ class CustomPlot(PamhyrPlot):
ts = list(results.get("timestamps"))
ts.sort()
self.canvas.axes.set_xlim(
left=min(ts), right=max(ts)
)
# self.canvas.axes.set_xlim(
# left=min(ts), right=max(ts)
# )
x = ts
lines = {}
@ -232,10 +232,10 @@ class CustomPlot(PamhyrPlot):
# Water elevation
z = profile.get_key("Z")
meter_axes.set_ylim(
bottom=min(0, min(z)),
top=max(z) + 1
)
# meter_axes.set_ylim(
# bottom=min(0, min(z)),
# top=max(z) + 1
# )
line = meter_axes.plot(
ts, z, lw=1.,
@ -260,10 +260,10 @@ class CustomPlot(PamhyrPlot):
if "discharge" in self._y:
q = profile.get_key("Q")
m3s_axes.set_ylim(
bottom=min(0, min(q)),
top=max(q) + 1
)
# m3s_axes.set_ylim(
# bottom=min(0, min(q)),
# top=max(q) + 1
# )
line = m3s_axes.plot(
ts, q, lw=1.,