From 9aa2310d2eb75d1102681f1f40e70abc99cf766c Mon Sep 17 00:00:00 2001
From: ldam <ldam@passcal.nmt.edu>
Date: Thu, 24 Aug 2023 12:10:45 -0600
Subject: [PATCH] checking for key ax in plotting_data1's channel and remove
 artist only necessary when replotting a channel

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

diff --git a/sohstationviewer/view/plotting/state_of_health_widget.py b/sohstationviewer/view/plotting/state_of_health_widget.py
index 847a7024e..bc219840a 100644
--- a/sohstationviewer/view/plotting/state_of_health_widget.py
+++ b/sohstationviewer/view/plotting/state_of_health_widget.py
@@ -66,16 +66,8 @@ class SOHWidget(MultiThreadedPlottingWidget):
         linked_ax = None
         if chan_db_info['linkedChan'] not in [None, 'None', '']:
             linked_ax = self.plotting_data1[chan_db_info['linkedChan']]['ax']
-        if 'ax' not in c_data:
-            ax = getattr(self.plotting, plot_functions[plot_type][1])(
-                c_data, chan_db_info, chan_id, None, linked_ax)
-            if ax is None:
-                return
-            c_data['ax'] = ax
-            ax.chan = chan_id
-            self.axes.append(ax)
-        else:
-            for artist in c_data['ax'].lines + c_data['ax'].collections:
-                artist.remove()
-            getattr(self.plotting, plot_functions[plot_type][1])(
-                c_data, chan_db_info, chan_id, c_data['ax'], linked_ax)
+        ax = getattr(self.plotting, plot_functions[plot_type][1])(
+            c_data, chan_db_info, chan_id, None, linked_ax)
+        c_data['ax'] = ax
+        ax.chan = chan_id
+        self.axes.append(ax)
-- 
GitLab