class_docstr: A set of lines that are temporally aligned on a trigger.
  
  Data is added in chunks to the oscilloscope, and each new chunk creates a
  new line to draw. Older lines are slowly faded out until they are removed.
  
  Parameters
  ----------
  n_lines : int
      The maximum number of lines to draw.
  line_size : int
      The number of samples in each line.
  dx : float
      The x spacing between adjacent samples in a line.
  color : tuple
      The base color to use when drawing lines. Older lines are faded by
      decreasing their alpha value.
  trigger : tuple
      A set of parameters (level, height, width) that determine how triggers
      are detected.
  parent : Node
      An optional parent scenegraph node.
class_docstr_tok: ["A","set","of","lines","that","are","temporally","aligned","on","a","trigger",".","Data","is","added","in","chunks","to","the","oscilloscope",",","and","each","new","chunk","creates","a","new","line","to","draw",".","Older","lines","are","slowly","faded","out","until","they","are","removed",".","Parameters","--","--","--","--","--","n_lines",":","int","The","maximum","number","of","lines","to","draw",".","line_size",":","int","The","number","of","samples","in","each","line",".","dx",":","float","The","x","spacing","between","adjacent","samples","in","a","line",".","color",":","tuple","The","base","color","to","use","when","drawing","lines",".","Older","lines","are","faded","by","decreasing","their","alpha","value",".","trigger",":","tuple","A","set","of","parameters","(","level",",","height",",","width",")","that","determine","how","triggers","are","detected",".","parent",":","Node","An","optional","parent","scenegraph","node","."]
code: def __init__(
      self,
      n_lines=100,
      line_size=1024,
      dx=1e-4,
      color=(20, 255, 50),
      trigger=(0, 0.002, 1e-4),
      parent=None,
  ):
      self._trigger = (
          trigger  # trigger_level, trigger_height, trigger_width
      )
  
      # lateral positioning for trigger
      self.pos_offset = np.zeros((n_lines, 3), dtype=np.float32)
  
      # color array to fade out older plots
      self.color = np.empty((n_lines, 4), dtype=np.ubyte)
      self.color[:, :3] = [list(color)]
      self.color[:, 3] = 0
      self._dim_speed = 0.01 ** (1 / n_lines)
  
      self.frames = []  # running list of recently received frames
      self.plot_ptr = 0
  
      scene.ScrollingLines.__init__(
          self,
          n_lines=n_lines,
          line_size=line_size,
          dx=dx,
          color=self.color,
          pos_offset=self.pos_offset,
          parent=parent,
      )
      self.set_gl_state("additive", line_width=2)
  
file_path: vispy/examples/demo/scene/oscilloscope.py
imports: from __future__ import division
  import threading
  import atexit
  import numpy
  from vispy import app, scene, gloo, visuals
  from vispy.util.filter import gaussian_filter
label_desc: Use image node_id 1 to create a new Oscilloscope object from inherited base classes: scene with example: obj = Oscilloscope(n_lines, line_size, dx, color, trigger, parent)