code: def cleanup(self):
          
          plots = self.traverse(lambda x: x, [Plot])
          for plot in plots:
              if not isinstance(plot, (GenericCompositePlot, GenericElementPlot, GenericOverlayPlot)):
                  continue
              for stream in set(plot.streams):
                  stream._subscribers = [
                      (p, subscriber) for p, subscriber in stream._subscribers
                      if util.get_method_owner(subscriber) not in plots]
          if self.comm:
              self.comm.close()
docs: Cleans up references to the plot on the attached Stream
          subscribers.