class_docstr: Infinite horizontal or vertical region for 2D plots.
  
  Parameters
  ----------
  pos : list, tuple or numpy array
      Bounds of the region along the axis. len(pos) must be >=2.
  color : list, tuple, or array
      The color to use when drawing the line. It must have a shape of
      (1, 4) for a single color region or (len(pos), 4) for a multicolor
      region.
  vertical:
      True for drawing a vertical region, False for an horizontal region
class_docstr_tok: ["Infinite","horizontal","or","vertical","region","for","2D","plots",".","Parameters","--","--","--","--","--","pos",":","list",",","tuple","or","numpy","array","Bounds","of","the","region","along","the","axis",".","len","(","pos",")","must","be",">","=2",".","color",":","list",",","tuple",",","or","array","The","color","to","use","when","drawing","the","line",".","It","must","have","a","shape","of","(","1",",","4",")","for","a","single","color","region","or","(","len","(","pos",")",",","4",")","for","a","multicolor","region",".","vertical",":","True","for","drawing","a","vertical","region",",","False","for","an","horizontal","region"]
docstr_tok: []
code: def __init__(
      self,
      pos=None,
      color=[1.0, 1.0, 1.0, 1.0],
      vertical=True,
      **kwargs,
  ):
      """ """
      Visual.__init__(
          self,
          vcode=self._shaders["vertex"],
          fcode=self._shaders["fragment"],
      )
  
      self._changed = {"pos": False, "color": False}
  
      self.pos_buf = gloo.VertexBuffer()
      self.color_buf = gloo.VertexBuffer()
      # The Visual superclass contains a MultiProgram, which is an object
      # that behaves like a normal shader program (you can assign shader
      # code, upload values, set template variables, etc.) but internally
      # manages multiple ModularProgram instances, one per view.
  
      # The MultiProgram is accessed via the `shared_program` property, so
      # the following modifications to the program will be applied to all
      # views:
      self.shared_program["a_pos"] = self.pos_buf
      self._program.vert["is_vertical"] = 1 if vertical else 0
  
      self._need_upload = False
      self._is_vertical = bool(vertical)
      self._pos = np.zeros((4, 2), dtype=np.float32)
      self._color = np.ones((1, 4), dtype=np.float32)
  
      # Visual keeps track of draw mode, index buffer, and GL state. These
      # are shared between all views.
      self._draw_mode = "triangle_strip"
      self.set_gl_state("translucent", depth_test=False)
  
      self.set_data(pos=pos, color=color)
  
file_path: vispy/vispy/visuals/linear_region.py
imports: import numpy
  from ..None import gloo
  from .visual import Visual
label_desc: Use image node_id 1 to create a new LinearRegionVisual object from inherited base classes: Visual with example: obj = LinearRegionVisual(pos, color, vertical)