Plot: Update plots after changing each data in tab

dev_dylan
Dylan Jeannin 2026-07-20 15:51:05 +02:00
parent 0d0c4f913e
commit 4e3da95b1d
7 changed files with 14 additions and 0 deletions

View File

@ -155,6 +155,7 @@ class EditBoundaryConditionWindow(PamhyrWindow):
def update(self):
self.plot.update()
self.plot.fit_to_data()
def index_selected_row(self):
table = self.find(QTableView, "tableView")

View File

@ -152,6 +152,7 @@ class EditBoundaryConditionWindow(PamhyrWindow):
def update(self):
self.plot.update()
self.plot.fit_to_data()
def index_selected_row(self):
table = self.find(QTableView, "tableView")

View File

@ -147,6 +147,7 @@ class EditLateralContributionWindow(PamhyrWindow):
def update(self):
self.plot.update()
self.plot.fit_to_data()
def index_selected_row(self):
table = self.find(QTableView, "tableView")

View File

@ -160,6 +160,7 @@ class EditLateralContributionAdisTSWindow(PamhyrWindow):
def update(self):
self.plot.update()
self.plot.fit_to_data()
def index_selected_row(self):
table = self.find(QTableView, "tableView")

View File

@ -137,6 +137,7 @@ class EditReservoirWindow(PamhyrWindow):
def update(self):
self.plot.update()
self.plot.fit_to_data()
def index_selected_row(self):
table = self.find(QTableView, "tableView")

View File

@ -208,6 +208,14 @@ class PamhyrPlot(APlot):
self.toolbar_update()
def fit_to_data(self):
"""Recompute the axes limits to show all currently plotted data."""
self.canvas.axes.relim()
self.canvas.axes.autoscale_view(True, True, True)
self.canvas.axes.autoscale()
self.canvas.figure.canvas.draw_idle()
self.toolbar_update()
def toolbar_update(self):
if self._toolbar is not None:
self._toolbar.update()

View File

@ -147,6 +147,7 @@ class EditWeatherParametersWindow(PamhyrWindow):
def update(self):
self.plot.update()
self.plot.fit_to_data()
def index_selected_row(self):
table = self.find(QTableView, "tableView")