              logger.debug("Updating plot with data from background thread")
              self.calcs = self.thread.get_result()  # Terminate the LongRunningTask object
              self.thread = None
  
              dsp_keys = list(sorted(self.calcs.stats))
              if dsp_keys != self._displayed_keys:
                  logger.debug("Reinitializing graph for keys change. Old keys: %s New keys: %s",
                               self._displayed_keys, dsp_keys)
                  initiate = True
                  self._displayed_keys = dsp_keys
 
</s> remove             self.calcs = self.thread.get_result()  # Terminate the LongRunningTask object
            self.thread = None
 </s> add             self._calcs = self._thread.get_result()  # Terminate the LongRunningTask object
            self._thread = None </s> remove         elif not self.thread.complete.is_set():
 </s> add         elif not self._thread.complete.is_set(): </s> remove             self.update_plot(initiate=initiate)
            self.plotcanvas.draw()
 </s> add             self._update_plot(initiate=initiate)
            self._plotcanvas.draw() </s> remove         self.thread = None  # Thread for LongRunningTask
 </s> add         self._thread = None  # Thread for LongRunningTask </s> remove     def add_callback(self):
        """ Add the variable trace to update graph on recent button or save iteration """
 </s> add     def _add_callback(self) -> None:
        """ Add the variable trace to update graph on refresh button press or save iteration. """
            dsp_keys = list(sorted(self._calcs.stats))
              logger.debug("Updating plot with data from background thread")
              self.calcs = self.thread.get_result()  # Terminate the LongRunningTask object
              self.thread = None
  
            dsp_keys = list(sorted(self._calcs.stats))
              if dsp_keys != self._displayed_keys:
                  logger.debug("Reinitializing graph for keys change. Old keys: %s New keys: %s",
                               self._displayed_keys, dsp_keys)
                  initiate = True
                  self._displayed_keys = dsp_keys
keep keep keep keep replace keep keep keep keep keep
 Update matplotlib requirement
  - bump min requirement to 3.5.1
  - Fix custom toolbar for v3.5.1
  - Documentation + linting 
lib/gui/display_graph.py