class_docstr: :class:`Path` represents a series of possibly disconnected,
  possibly closed, line and curve segments.
  
  The underlying storage is made up of two parallel numpy arrays:
    - *vertices*: an Nx2 float array of vertices
    - *codes*: an N-length uint8 array of vertex types
  
  These two arrays always have the same length in the first
  dimension.  For example, to represent a cubic curve, you must
  provide three vertices as well as three codes ``CURVE3``.
  
  The code types are:
  
     - ``STOP``   :  1 vertex (ignored)
         A marker for the end of the entire path (currently not
         required and ignored)
  
     - ``MOVETO`` :  1 vertex
          Pick up the pen and move to the given vertex.
  
     - ``LINETO`` :  1 vertex
          Draw a line from the current position to the given vertex.
  
     - ``CURVE3`` :  1 control point, 1 endpoint
        Draw a quadratic Bezier curve from the current position,
        with the given control point, to the given end point.
  
     - ``CURVE4`` :  2 control points, 1 endpoint
        Draw a cubic Bezier curve from the current position, with
        the given control points, to the given end point.
  
     - ``CLOSEPOLY`` : 1 vertex (ignored)
        Draw a line segment to the start point of the current
        polyline.
  
  Users of Path objects should not access the vertices and codes
  arrays directly.  Instead, they should use :meth:`iter_segments`
  or :meth:`cleaned` to get the vertex/code pairs.  This is important,
  since many :class:`Path` objects, as an optimization, do not store a
  *codes* at all, but have a default one provided for them by
  :meth:`iter_segments`.
  
  Some behavior of Path objects can be controlled by rcParams. See
  the rcParams whose keys contain 'path.'.
  
  .. note::
  
      The vertices and codes arrays should be treated as
      immutable -- there are a number of optimizations and assumptions
      made up front in the constructor that will not change when the
      data changes.
class_docstr_tok: [":","class",":","`","Path","`","represents","a","series","of","possibly","disconnected",",","possibly","closed",",","line","and","curve","segments",".","The","underlying","storage","is","made","up","of","two","parallel","numpy","arrays",":","-","*","vertices","*",":","an","Nx2","float","array","of","vertices","-","*","codes","*",":","an","N-length","uint8","array","of","vertex","types","These","two","arrays","always","have","the","same","length","in","the","first","dimension",".","For","example",",","to","represent","a","cubic","curve",",","you","must","provide","three","vertices","as","well","as","three","codes","``","CURVE3","``",".","The","code","types","are",":","-","``","STOP","``",":","1","vertex","(","ignored",")","A","marker","for","the","end","of","the","entire","path","(","currently","not","required","and","ignored",")","-","``","MOVETO","``",":","1","vertex","Pick","up","the","pen","and","move","to","the","given","vertex",".","-","``","LINETO","``",":","1","vertex","Draw","a","line","from","the","current","position","to","the","given","vertex",".","-","``","CURVE3","``",":","1","control","point",",","1","endpoint","Draw","a","quadratic","Bezier","curve","from","the","current","position",",","with","the","given","control","point",",","to","the","given","end","point",".","-","``","CURVE4","``",":","2","control","points",",","1","endpoint","Draw","a","cubic","Bezier","curve","from","the","current","position",",","with","the","given","control","points",",","to","the","given","end","point",".","-","``","CLOSEPOLY","``",":","1","vertex","(","ignored",")","Draw","a","line","segment","to","the","start","point","of","the","current","polyline",".","Users","of","Path","objects","should","not","access","the","vertices","and","codes","arrays","directly",".","Instead",",","they","should","use",":","meth",":","`","iter_segments","`","or",":","meth",":","`","cleaned","`","to","get","the","vertex\/code","pairs",".","This","is","important",",","since","many",":","class",":","`","Path","`","objects",",","as","an","optimization",",","do","not","store","a","*","codes","*","at","all",",","but","have","a","default","one","provided","for","them","by",":","meth",":","`","iter_segments","`",".","Some","behavior","of","Path","objects","can","be","controlled","by","rcParams",".","See","the","rcParams","whose","keys","contain","'path.","'",".","..","note",":",":","The","vertices","and","codes","arrays","should","be","treated","as","immutable","--","there","are","a","number","of","optimizations","and","assumptions","made","up","front","in","the","constructor","that","will","not","change","when","the","data","changes","."]
docstr: Iterates over all of the curve segments in the path.  Each
  iteration returns a 2-tuple (*vertices*, *code*), where
  *vertices* is a sequence of 1 - 3 coordinate pairs, and *code* is
  one of the :class:`Path` codes.
  
  Additionally, this method can provide a number of standard
  cleanups and conversions to the path.
  
  Parameters
  ----------
  transform : None or :class:`~matplotlib.transforms.Transform` instance
      If not None, the given affine transformation will
      be applied to the path.
  remove_nans : {False, True}, optional
      If True, will remove all NaNs from the path and
      insert MOVETO commands to skip over them.
  clip : None or sequence, optional
      If not None, must be a four-tuple (x1, y1, x2, y2)
      defining a rectangle in which to clip the path.
  snap : None or bool, optional
      If None, auto-snap to pixels, to reduce
      fuzziness of rectilinear lines.  If True, force snapping, and
      if False, don't snap.
  stroke_width : float, optional
      The width of the stroke being drawn.  Needed
       as a hint for the snapping algorithm.
  simplify : None or bool, optional
      If True, perform simplification, to remove
       vertices that do not affect the appearance of the path.  If
       False, perform no simplification.  If None, use the
       should_simplify member variable.  See also the rcParams
       path.simplify and path.simplify_threshold.
  curves : {True, False}, optional
      If True, curve segments will be returned as curve
      segments.  If False, all curves will be converted to line
      segments.
  sketch : None or sequence, optional
      If not None, must be a 3-tuple of the form
      (scale, length, randomness), representing the sketch
      parameters.
docstr_tok: ["Iterates","over","all","of","the","curve","segments","in","the","path",".","Each","iteration","returns","a","2-tuple","(","*","vertices","*",",","*","code","*",")",",","where","*","vertices","*","is","a","sequence","of","1","-","3","coordinate","pairs",",","and","*","code","*","is","one","of","the",":","class",":","`","Path","`","codes",".","Additionally",",","this","method","can","provide","a","number","of","standard","cleanups","and","conversions","to","the","path",".","Parameters","--","--","--","--","--","transform",":","None","or",":","class",":","`","~matplotlib.transforms.Transform","`","instance","If","not","None",",","the","given","affine","transformation","will","be","applied","to","the","path",".","remove_nans",":","{","False",",","True","}",",","optional","If","True",",","will","remove","all","NaNs","from","the","path","and","insert","MOVETO","commands","to","skip","over","them",".","clip",":","None","or","sequence",",","optional","If","not","None",",","must","be","a","four-tuple","(","x1",",","y1",",","x2",",","y2",")","defining","a","rectangle","in","which","to","clip","the","path",".","snap",":","None","or","bool",",","optional","If","None",",","auto-snap","to","pixels",",","to","reduce","fuzziness","of","rectilinear","lines",".","If","True",",","force","snapping",",","and","if","False",",","do","n't","snap",".","stroke_width",":","float",",","optional","The","width","of","the","stroke","being","drawn",".","Needed","as","a","hint","for","the","snapping","algorithm",".","simplify",":","None","or","bool",",","optional","If","True",",","perform","simplification",",","to","remove","vertices","that","do","not","affect","the","appearance","of","the","path",".","If","False",",","perform","no","simplification",".","If","None",",","use","the","should_simplify","member","variable",".","See","also","the","rcParams","path.simplify","and","path.simplify_threshold",".","curves",":","{","True",",","False","}",",","optional","If","True",",","curve","segments","will","be","returned","as","curve","segments",".","If","False",",","all","curves","will","be","converted","to","line","segments",".","sketch",":","None","or","sequence",",","optional","If","not","None",",","must","be","a","3-tuple","of","the","form","(","scale",",","length",",","randomness",")",",","representing","the","sketch","parameters","."]
code: def iter_segments(
      self,
      transform=None,
      remove_nans=True,
      clip=None,
      snap=False,
      stroke_width=1.0,
      simplify=None,
      curves=True,
      sketch=None,
  ):
      """
      Iterates over all of the curve segments in the path.  Each
      iteration returns a 2-tuple (*vertices*, *code*), where
      *vertices* is a sequence of 1 - 3 coordinate pairs, and *code* is
      one of the :class:`Path` codes.
  
      Additionally, this method can provide a number of standard
      cleanups and conversions to the path.
  
      Parameters
      ----------
      transform : None or :class:`~matplotlib.transforms.Transform` instance
          If not None, the given affine transformation will
          be applied to the path.
      remove_nans : {False, True}, optional
          If True, will remove all NaNs from the path and
          insert MOVETO commands to skip over them.
      clip : None or sequence, optional
          If not None, must be a four-tuple (x1, y1, x2, y2)
          defining a rectangle in which to clip the path.
      snap : None or bool, optional
          If None, auto-snap to pixels, to reduce
          fuzziness of rectilinear lines.  If True, force snapping, and
          if False, don't snap.
      stroke_width : float, optional
          The width of the stroke being drawn.  Needed
           as a hint for the snapping algorithm.
      simplify : None or bool, optional
          If True, perform simplification, to remove
           vertices that do not affect the appearance of the path.  If
           False, perform no simplification.  If None, use the
           should_simplify member variable.  See also the rcParams
           path.simplify and path.simplify_threshold.
      curves : {True, False}, optional
          If True, curve segments will be returned as curve
          segments.  If False, all curves will be converted to line
          segments.
      sketch : None or sequence, optional
          If not None, must be a 3-tuple of the form
          (scale, length, randomness), representing the sketch
          parameters.
      """
      if not len(self):
          return
  
      cleaned = self.cleaned(
          transform=transform,
          remove_nans=remove_nans,
          clip=clip,
          snap=snap,
          stroke_width=stroke_width,
          simplify=simplify,
          curves=curves,
          sketch=sketch,
      )
      vertices = cleaned.vertices
      codes = cleaned.codes
      len_vertices = vertices.shape[0]
  
      # Cache these object lookups for performance in the loop.
      NUM_VERTICES_FOR_CODE = self.NUM_VERTICES_FOR_CODE
      STOP = self.STOP
  
      i = 0
      while i < len_vertices:
          code = codes[i]
          if code == STOP:
              return
          else:
              num_vertices = NUM_VERTICES_FOR_CODE[code]
              curr_vertices = vertices[i : i + num_vertices].flatten()
              yield curr_vertices, code
              i += num_vertices
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from weakref import WeakValueDictionary
  import numpy
  from .None import _path, rcParams
  from .cbook import _to_unmasked_float_array, simple_linear_interpolation, maxdict
label_desc: Use image node_id 20 for calling the Path obj's underlying member method code with example usage: obj.iter_segments(transform, remove_nans, clip, snap, stroke_width, simplify, curves, sketch) without return types