diff --git a/src/View/InitialConditions/PlotDKP.py b/src/View/InitialConditions/PlotDKP.py index 2c1031d7d3c4db5d6828ecdd9fd3f429f7545b86..60fd433528bf894274bcd1312e7cba9fb16b5bf7 100644 --- a/src/View/InitialConditions/PlotDKP.py +++ b/src/View/InitialConditions/PlotDKP.py @@ -30,16 +30,20 @@ class PlotDKP(APlot): self.canvas.axes.set_ylabel( _translate("MainWindow_reach", "Draft (m)"), - color='green', fontsize=12 + color='green', fontsize=11 ) self.canvas.axes.set_xlabel( _translate("MainWindow_reach", "KP (m)"), - color='green', fontsize=12 + color='green', fontsize=11 ) kp = self.data.reach.reach.get_kp() z_min = self.data.reach.reach.get_z_min() + self.canvas.axes.set_xlim( + left = min(kp), right = max(kp) + ) + self.line_kp_zmin = self.canvas.axes.plot( kp, z_min, color='grey', lw=1. diff --git a/src/View/InitialConditions/PlotFlow.py b/src/View/InitialConditions/PlotFlow.py index 6ef5a8aaf640b335746659129de5c22b523c8f9f..16f29eb4aef51b62f85c7379432ca8d58f1fd72d 100644 --- a/src/View/InitialConditions/PlotFlow.py +++ b/src/View/InitialConditions/PlotFlow.py @@ -29,12 +29,18 @@ class PlotFlow(APlot): return self.canvas.axes.set_ylabel( - _translate("MainWindow_reach", "Flow (m³/s)"), - color='green', fontsize=12 + _translate("MainWindow_reach", "Flow (m^3/s)"), + color='green', fontsize=11 ) self.canvas.axes.set_xlabel( _translate("MainWindow_reach", "KP (m)"), - color='green', fontsize=12 + color='green', fontsize=11 + ) + + kp = self.data.reach.reach.get_kp() + + self.canvas.axes.set_xlim( + left = min(kp), right = max(kp) ) kp = self.data.get_kp() diff --git a/src/View/InitialConditions/Window.py b/src/View/InitialConditions/Window.py index 2933cd4745ead888983720ed42db0405ce09f2f7..91d2c975b85fac75397f8f2ca146aa65c4ca66da 100644 --- a/src/View/InitialConditions/Window.py +++ b/src/View/InitialConditions/Window.py @@ -119,7 +119,6 @@ class InitialConditionsWindow(ASubMainWindow, ListedSubWindow): data = self._ics, toolbar = None, ) - self.plot_2.draw() def setup_connections(self): diff --git a/src/View/LateralContribution/Window.py b/src/View/LateralContribution/Window.py index 5664df8b286e19ab968880cbc12aa4ce584b25e1..a6b7b03e0ec081e746cd45931618aed34a907abd 100644 --- a/src/View/LateralContribution/Window.py +++ b/src/View/LateralContribution/Window.py @@ -197,6 +197,8 @@ class LateralContributionWindow(ASubMainWindow, ListedSubWindow): else: self._table[tab].add(rows[0]) + self._set_current_reach() + def delete(self): tab = self.current_tab() rows = self.index_selected_rows() @@ -204,34 +206,42 @@ class LateralContributionWindow(ASubMainWindow, ListedSubWindow): return self._table[tab].delete(rows) + self._set_current_reach() def sort(self): tab = self.current_tab() self._table[tab].sort(False) + self._set_current_reach() def move_up(self): tab = self.current_tab() row = self.index_selected_row() self._table[tab].move_up(row) + self._set_current_reach() def move_down(self): tab = self.current_tab() row = self.index_selected_row() self._table[tab].move_down(row) + self._set_current_reach() def copy(self): print("TODO") + self._set_current_reach() def paste(self): print("TODO") + self._set_current_reach() def undo(self): tab = self.current_tab() self._table[tab].undo() + self._set_current_reach() def redo(self): tab = self.current_tab() self._table[tab].redo() + self._set_current_reach() def edit(self): tab = self.current_tab()