class_docstr: Displays an isocurve of a 2D scalar array.
  
  Parameters
  ----------
  data : ndarray | None
      2D scalar array.
  levels : ndarray, shape (Nlev,) | None
      The levels at which the isocurve is constructed from "*data*".
  color_lev : Color, colormap name, tuple, list or array
      The color to use when drawing the line. If a list is given, it
      must be of shape (Nlev), if an array is given, it must be of
      shape (Nlev, ...). and provide one color per level (rgba, colorname).
  clim : tuple
      (min, max) limits to apply when mapping level values through a
      colormap.
  **kwargs : dict
      Keyword arguments to pass to `LineVisual`.
class_docstr_tok: ["Displays","an","isocurve","of","a","2D","scalar","array",".","Parameters","--","--","--","--","--","data",":","ndarray","|","None","2D","scalar","array",".","levels",":","ndarray",",","shape","(","Nlev",",",")","|","None","The","levels","at","which","the","isocurve","is","constructed","from","``","*","data","*","''",".","color_lev",":","Color",",","colormap","name",",","tuple",",","list","or","array","The","color","to","use","when","drawing","the","line",".","If","a","list","is","given",",","it","must","be","of","shape","(","Nlev",")",",","if","an","array","is","given",",","it","must","be","of","shape","(","Nlev",",","...",")",".","and","provide","one","color","per","level","(","rgba",",","colorname",")",".","clim",":","tuple","(","min",",","max",")","limits","to","apply","when","mapping","level","values","through","a","colormap",".","*","*","kwargs",":","dict","Keyword","arguments","to","pass","to","`","LineVisual","`","."]
docstr: Compute LineVisual vertices, connects and color-index
docstr_tok: ["Compute","LineVisual","vertices",",","connects","and","color-index"]
code: def _compute_iso_line(self):
      """Compute LineVisual vertices, connects and color-index"""
      level_index = []
      connects = []
      verts = []
  
      # calculate which level are within data range
      # this works for now and the existing examples, but should be tested
      # thoroughly also with the data-sanity check in set_data-function
      choice = np.nonzero(
          (self.levels > self._data.min())
          & (self.levels < self._data.max())
      )
      levels_to_calc = np.array(self.levels)[choice]
  
      # save minimum level index
      self._level_min = choice[0][0]
  
      try:
          from skimage.measure import find_contours
      except ImportError:
          find_contours = None
  
      for level in levels_to_calc:
          # if we use skimage isoline algorithm we need to add half a
          # pixel in both (x,y) dimensions because isolines are aligned to
          # pixel centers
          if find_contours is not None:
              contours = find_contours(
                  self._data, level, positive_orientation="high"
              )
              v, c = self._get_verts_and_connect(contours)
              # swap row, column to column, row (x, y)
              v[:, [0, 1]] = v[:, [1, 0]]
              v += np.array([0.5, 0.5])
          else:
              paths = isocurve(
                  self._data.astype(float).T,
                  level,
                  extend_to_edge=True,
                  connected=True,
              )
              v, c = self._get_verts_and_connect(paths)
  
          level_index.append(v.shape[0])
          connects.append(np.hstack((c, [False])))
          verts.append(v)
  
      self._li = np.hstack(level_index)
      self._connect = np.hstack(connects)
      self._verts = np.vstack(verts)
  
file_path: vispy/vispy/visuals/isocurve.py
imports: from __future__ import division
  import numpy
  from .line import LineVisual
  from ..color import ColorArray
  from ..color.colormap import _normalize, get_colormap
  from ..geometry.isocurve import isocurve
label_desc: Use image node_id 8 for calling the IsocurveVisual obj's underlying member method code with example usage: obj._compute_iso_line() without return types