From 50967518303452c4478292f98ce828af74cc9898 Mon Sep 17 00:00:00 2001
From: ldam <ldam@passcal.nmt.edu>
Date: Thu, 24 Aug 2023 14:07:08 -0600
Subject: [PATCH] remove checking for ax_wf in
 WaveforWidget.plot_single_channel() because checking for key ax_wf in
 plotting_data1's channel and remove artist only necessary when replotting a
 channel

---
 .../view/plotting/waveform_dialog.py           | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/sohstationviewer/view/plotting/waveform_dialog.py b/sohstationviewer/view/plotting/waveform_dialog.py
index e32537fb3..19ff27ad7 100755
--- a/sohstationviewer/view/plotting/waveform_dialog.py
+++ b/sohstationviewer/view/plotting/waveform_dialog.py
@@ -51,19 +51,11 @@ class WaveformWidget(MultiThreadedPlottingWidget):
         plot_type = chan_db_info['plotType']
 
         # refer to doc string for mass_pos_data to know the reason for 'ax_wf'
-        if 'ax_wf' not in c_data:
-            ax = getattr(self.plotting, plot_functions[plot_type][1])(
-                c_data, chan_db_info, chan_id, None, None)
-            if ax is None:
-                return
-            c_data['ax_wf'] = ax
-            ax.chan = chan_id
-            self.axes.append(ax)
-        else:
-            for artist in c_data['ax_wf'].lines + c_data['ax_wf'].collections:
-                artist.remove()
-            getattr(self.plotting, plot_functions[plot_type][1])(
-                c_data, chan_db_info, chan_id, c_data['ax_wf'], None)
+        ax = getattr(self.plotting, plot_functions[plot_type][1])(
+            c_data, chan_db_info, chan_id, None, None)
+        c_data['ax_wf'] = ax
+        ax.chan = chan_id
+        self.axes.append(ax)
 
 
 class WaveformDialog(QtWidgets.QWidget):
-- 
GitLab