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: Create a new path with the given vertices and codes.
  
  Parameters
  ----------
  vertices : array_like
      The ``(n, 2)`` float array, masked array or sequence of pairs
      representing the vertices of the path.
  
      If *vertices* contains masked values, they will be converted
      to NaNs which are then handled correctly by the Agg
      PathIterator and other consumers of path data, such as
      :meth:`iter_segments`.
  codes : {None, array_like}, optional
      n-length array integers representing the codes of the path.
      If not None, codes must be the same length as vertices.
      If None, *vertices* will be treated as a series of line segments.
  _interpolation_steps : int, optional
      Used as a hint to certain projections, such as Polar, that this
      path should be linearly interpolated immediately before drawing.
      This attribute is primarily an implementation detail and is not
      intended for public use.
  closed : bool, optional
      If *codes* is None and closed is True, vertices will be treated as
      line segments of a closed polygon.
  readonly : bool, optional
      Makes the path behave in an immutable way and sets the vertices
      and codes as read-only arrays.
docstr_tok: ["Create","a","new","path","with","the","given","vertices","and","codes",".","Parameters","--","--","--","--","--","vertices",":","array_like","The","``","(","n",",","2",")","``","float","array",",","masked","array","or","sequence","of","pairs","representing","the","vertices","of","the","path",".","If","*","vertices","*","contains","masked","values",",","they","will","be","converted","to","NaNs","which","are","then","handled","correctly","by","the","Agg","PathIterator","and","other","consumers","of","path","data",",","such","as",":","meth",":","`","iter_segments","`",".","codes",":","{","None",",","array_like","}",",","optional","n-length","array","integers","representing","the","codes","of","the","path",".","If","not","None",",","codes","must","be","the","same","length","as","vertices",".","If","None",",","*","vertices","*","will","be","treated","as","a","series","of","line","segments",".","_interpolation_steps",":","int",",","optional","Used","as","a","hint","to","certain","projections",",","such","as","Polar",",","that","this","path","should","be","linearly","interpolated","immediately","before","drawing",".","This","attribute","is","primarily","an","implementation","detail","and","is","not","intended","for","public","use",".","closed",":","bool",",","optional","If","*","codes","*","is","None","and","closed","is","True",",","vertices","will","be","treated","as","line","segments","of","a","closed","polygon",".","readonly",":","bool",",","optional","Makes","the","path","behave","in","an","immutable","way","and","sets","the","vertices","and","codes","as","read-only","arrays","."]
code: def __init__(
      self,
      vertices,
      codes=None,
      _interpolation_steps=1,
      closed=False,
      readonly=False,
  ):
      """
      Create a new path with the given vertices and codes.
  
      Parameters
      ----------
      vertices : array_like
          The ``(n, 2)`` float array, masked array or sequence of pairs
          representing the vertices of the path.
  
          If *vertices* contains masked values, they will be converted
          to NaNs which are then handled correctly by the Agg
          PathIterator and other consumers of path data, such as
          :meth:`iter_segments`.
      codes : {None, array_like}, optional
          n-length array integers representing the codes of the path.
          If not None, codes must be the same length as vertices.
          If None, *vertices* will be treated as a series of line segments.
      _interpolation_steps : int, optional
          Used as a hint to certain projections, such as Polar, that this
          path should be linearly interpolated immediately before drawing.
          This attribute is primarily an implementation detail and is not
          intended for public use.
      closed : bool, optional
          If *codes* is None and closed is True, vertices will be treated as
          line segments of a closed polygon.
      readonly : bool, optional
          Makes the path behave in an immutable way and sets the vertices
          and codes as read-only arrays.
      """
      vertices = _to_unmasked_float_array(vertices)
      if (vertices.ndim != 2) or (vertices.shape[1] != 2):
          raise ValueError(
              "'vertices' must be a 2D list or array with shape Nx2"
          )
  
      if codes is not None:
          codes = np.asarray(codes, self.code_type)
          if (codes.ndim != 1) or len(codes) != len(vertices):
              raise ValueError(
                  "'codes' must be a 1D list or array with the "
                  "same length of 'vertices'"
              )
          if len(codes) and codes[0] != self.MOVETO:
              raise ValueError(
                  "The first element of 'code' must be equal "
                  "to 'MOVETO' ({})".format(self.MOVETO)
              )
      elif closed:
          codes = np.empty(len(vertices), dtype=self.code_type)
          codes[0] = self.MOVETO
          codes[1:-1] = self.LINETO
          codes[-1] = self.CLOSEPOLY
  
      self._vertices = vertices
      self._codes = codes
      self._interpolation_steps = _interpolation_steps
      self._update_values()
  
      if readonly:
          self._vertices.flags.writeable = False
          if self._codes is not None:
              self._codes.flags.writeable = False
          self._readonly = True
      else:
          self._readonly = False
  
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 1 to create a new Path object from inherited base classes: object with example: obj = Path(vertices, codes, _interpolation_steps, closed, readonly)