code: def clear_plot(self, stream_vis, clear_history):
      import matplotlib
  
      lines = stream_vis.ax.get_lines()
      # if we need to keep history
      if stream_vis.history_len > 1:
          # make sure we have history len - 1 lines
          lines_keep = (
              0 if clear_history else stream_vis.history_len - 1
          )
          while len(lines) > lines_keep:
              lines.pop(0).remove()
          # dim old lines
          if stream_vis.dim_history and len(lines) > 0:
              alphas = np.linspace(0.05, 1, len(lines))
              for line, opacity in zip(lines, alphas):
                  line.set_alpha(opacity)
                  line.set_linewidth(1)
          # add new line
          line = matplotlib.lines.Line2D(
              [], [], linewidth=stream_vis.linewidth
          )
          stream_vis.ax.add_line(line)
      else:  # clear current line
          lines[-1].set_data([], [])
      if stream_vis.fill_between_col is not None:
          stream_vis.fill_between_col.remove()
      # remove annotations
      for label_info in stream_vis.xylabel_refs:
          label_info.set_visible(False)
          label_info.remove()
      stream_vis.xylabel_refs.clear()
  
file_path: tensorwatch/tensorwatch/mpl/line_plot.py
imports: from .base_mpl_plot import BaseMplPlot
  from ..None import image_utils
  from ..None import utils
  import numpy
  from ..lv_types import PointData
label_desc: Use image node_id 3 for calling the LinePlot obj's underlying member method code with example usage: obj.clear_plot(stream_vis, clear_history) without return types