diff --git a/View/acoustic_data_tab.py b/View/acoustic_data_tab.py index 359e55d..eafe594 100644 --- a/View/acoustic_data_tab.py +++ b/View/acoustic_data_tab.py @@ -2502,6 +2502,7 @@ class AcousticDataTab(QWidget): if self.fig_BS is not None: self.fig_BS.clear() + plt.close(self.fig_BS) self.fig_BS, self.axis_BS = plt.subplots( nrows=stg.freq[file_id].shape[0], @@ -2682,6 +2683,7 @@ class AcousticDataTab(QWidget): # --- Figure to plot profiles --- if self.fig_profile is not None: self.fig_profile.clear() + plt.close(self.fig_profile) self.fig_profile, self.axis_profile = plt.subplots(nrows=1, ncols=1, layout="constrained") self.canvas_plot_profile = FigureCanvas(self.fig_profile) diff --git a/View/sample_data_tab.py b/View/sample_data_tab.py index 5a74074..7de3ee1 100644 --- a/View/sample_data_tab.py +++ b/View/sample_data_tab.py @@ -799,6 +799,7 @@ class SampleDataTab(QWidget): if self.figure_plot_sample_position_on_transect is not None: self.figure_plot_sample_position_on_transect.clear() + plt.close(self.figure_plot_sample_position_on_transect) fig, axis = plt.subplots(nrows=1, ncols=1, layout="constrained") @@ -1427,6 +1428,7 @@ class SampleDataTab(QWidget): if self.figure_total_concentration is not None: self.figure_total_concentration.clear() + plt.close(self.figure_total_concentration) self.figure_total_concentration, self.axis_total_concentration \ = plt.subplots(nrows=1, ncols=1, layout="constrained") @@ -1715,6 +1717,7 @@ class SampleDataTab(QWidget): if self.figure_plot_PSD is not None: self.figure_plot_PSD.clear() + plt.close(self.figure_plot_PSD) self.figure_plot_PSD, self.axis_plot_PSD \ = plt.subplots(nrows=1, ncols=2, layout="constrained") diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index 759982e..8a92eb2 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -1040,6 +1040,7 @@ class SedimentCalibrationTab(QWidget): if self.fig_BS is not None: self.fig_BS.clear() + plt.close(self.fig_BS) self.fig_BS, self.axis_BS = plt.subplots( nrows=1, ncols=1, sharex=True, sharey=False, @@ -1407,6 +1408,7 @@ class SedimentCalibrationTab(QWidget): if self.fig_Mfine is not None: self.fig_Mfine.clear() + plt.close(self.fig_Mfine) self.fig_Mfine, self.ax_Mfine = plt.subplots(1, 1, layout="constrained") self.canvas_Mfine = FigureCanvas(self.fig_Mfine) @@ -2302,6 +2304,7 @@ class SedimentCalibrationTab(QWidget): if self.fig_FCB is not None: self.fig_FCB.clear() + plt.close(self.fig_FCB) self.fig_FCB, self.axis_FCB = plt.subplots( nrows=1, ncols=1, layout="constrained" diff --git a/View/signal_processing_tab.py b/View/signal_processing_tab.py index e41f9f8..c50077c 100644 --- a/View/signal_processing_tab.py +++ b/View/signal_processing_tab.py @@ -864,6 +864,7 @@ class SignalProcessingTab(QWidget): if self.fig_profile_tail is not None: self.fig_profile_tail.clear() + plt.close(self.fig_profile_tail) self.fig_profile_tail, self.axis_profile_tail = \ plt.subplots(nrows=1, ncols=1, layout='constrained') @@ -1230,6 +1231,7 @@ class SignalProcessingTab(QWidget): if self.fig_noise is not None: self.fig_noise.clear() + plt.close(self.fig_noise) self.fig_noise, self.axis_noise = plt.subplots( nrows=1, ncols=1, layout="constrained" @@ -1283,6 +1285,7 @@ class SignalProcessingTab(QWidget): if self.fig_SNR is not None: self.fig_SNR.clear() + plt.close(self.fig_SNR) self.fig_SNR, self.axis_SNR = plt.subplots( nrows=stg.freq[data_id].shape[0], ncols=1, @@ -1466,6 +1469,7 @@ class SignalProcessingTab(QWidget): if self.fig_BS is not None: self.fig_BS.clear() + plt.close(self.fig_BS) self.fig_BS, self.axis_BS = plt.subplots( nrows=stg.freq[data_id].shape[0], ncols=1, @@ -1700,6 +1704,7 @@ class SignalProcessingTab(QWidget): if self.figure_profile is not None: self.figure_profile.clear() + plt.close(self.figure_profile) self.figure_profile, self.axis_profile = plt.subplots( nrows=1, ncols=1, layout="constrained"