mirror of
https://forgemia.inra.fr/theophile.terraz/acoused.git
synced 2026-10-30 03:10:40 +01:00
Sample data: Clear plots at redraw.
This commit is contained in:
1 parent
583da806e4
commit
334390abdb
1 file changed
+15
@@ -64,6 +64,7 @@ class SampleDataTab(QWidget):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
icon_folder = QIcon(os.path.join("icons", "folder.png"))
|
icon_folder = QIcon(os.path.join("icons", "folder.png"))
|
||||||
|
self._setup_attrs()
|
||||||
|
|
||||||
### --- General layout of widgets ---
|
### --- General layout of widgets ---
|
||||||
|
|
||||||
@@ -257,6 +258,11 @@ class SampleDataTab(QWidget):
|
|||||||
|
|
||||||
self.combobox_PSD_plot.currentTextChanged.connect(self.plot_PSD_fine_and_sand_sediments)
|
self.combobox_PSD_plot.currentTextChanged.connect(self.plot_PSD_fine_and_sand_sediments)
|
||||||
|
|
||||||
|
def _setup_attrs(self):
|
||||||
|
self.figure_plot_sample_position_on_transect = None
|
||||||
|
self.figure_total_concentration = None
|
||||||
|
self.figure_plot_PSD = None
|
||||||
|
|
||||||
# -------------------- Functions for Sample Data Tab --------------------
|
# -------------------- Functions for Sample Data Tab --------------------
|
||||||
|
|
||||||
def retranslate_data_sample_tab(self):
|
def retranslate_data_sample_tab(self):
|
||||||
@@ -789,6 +795,9 @@ class SampleDataTab(QWidget):
|
|||||||
self.verticalLayout_groupbox_plot_transect\
|
self.verticalLayout_groupbox_plot_transect\
|
||||||
.removeWidget(self.canvas_plot_sample_position_on_transect)
|
.removeWidget(self.canvas_plot_sample_position_on_transect)
|
||||||
|
|
||||||
|
if self.figure_plot_sample_position_on_transect is not None:
|
||||||
|
self.figure_plot_sample_position_on_transect.clear()
|
||||||
|
|
||||||
fig, axis = plt.subplots(nrows=1, ncols=1, layout="constrained")
|
fig, axis = plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||||
|
|
||||||
self.figure_plot_sample_position_on_transect = fig
|
self.figure_plot_sample_position_on_transect = fig
|
||||||
@@ -1414,6 +1423,9 @@ class SampleDataTab(QWidget):
|
|||||||
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.canvas_plot_total_concentration)
|
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.canvas_plot_total_concentration)
|
||||||
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.toolbar_plot_total_concentration)
|
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.toolbar_plot_total_concentration)
|
||||||
|
|
||||||
|
if self.figure_total_concentration is not None:
|
||||||
|
self.figure_total_concentration.clear()
|
||||||
|
|
||||||
self.figure_total_concentration, self.axis_total_concentration \
|
self.figure_total_concentration, self.axis_total_concentration \
|
||||||
= plt.subplots(nrows=1, ncols=1, layout="constrained")
|
= plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||||
self.canvas_plot_total_concentration = FigureCanvas(self.figure_total_concentration)
|
self.canvas_plot_total_concentration = FigureCanvas(self.figure_total_concentration)
|
||||||
@@ -1699,6 +1711,9 @@ class SampleDataTab(QWidget):
|
|||||||
self.verticalLayout_groupbox_plot_PSD.removeWidget(self.canvas_plot_PSD)
|
self.verticalLayout_groupbox_plot_PSD.removeWidget(self.canvas_plot_PSD)
|
||||||
self.verticalLayout_groupbox_plot_PSD.removeWidget(self.toolbar_plot_PSD)
|
self.verticalLayout_groupbox_plot_PSD.removeWidget(self.toolbar_plot_PSD)
|
||||||
|
|
||||||
|
if self.figure_plot_PSD is not None:
|
||||||
|
self.figure_plot_PSD.clear()
|
||||||
|
|
||||||
self.figure_plot_PSD, self.axis_plot_PSD \
|
self.figure_plot_PSD, self.axis_plot_PSD \
|
||||||
= plt.subplots(nrows=1, ncols=2, layout="constrained")
|
= plt.subplots(nrows=1, ncols=2, layout="constrained")
|
||||||
self.canvas_plot_PSD = FigureCanvas(self.figure_plot_PSD)
|
self.canvas_plot_PSD = FigureCanvas(self.figure_plot_PSD)
|
||||||
|
|||||||
Reference in new issue
Block a user