code: def update(self, y):
      lastt = self.tdata[-1]
      if lastt >= self.tdata[0] + self.maxt:  # reset the arrays
          self.tdata = [self.tdata[-1]]
          self.ydata = [self.ydata[-1]]
          self.ax.set_xlim(self.tdata[0], self.tdata[0] + self.maxt)
          self.ax.figure.canvas.draw()
  
      # This slightly more complex calculation avoids floating-point issues
      # from just repeatedly adding `self.dt` to the previous value.
      t = self.tdata[0] + len(self.tdata) * self.dt
  
      self.tdata.append(t)
      self.ydata.append(y)
      self.line.set_data(self.tdata, self.ydata)
      return (self.line,)
  
file_path: matplotlib/galleries/examples/animation/strip_chart.py
imports: import matplotlib.pyplot
  import numpy
  import matplotlib.animation
  from matplotlib.lines import Line2D
label_desc: Use image node_id 2 for calling the Scope obj's underlying member method code with example usage: obj.update(y) and returns: self