class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","GraphicsObject","<","pyqtgraph.GraphicsObject",">","`"]
docstr: Create a pseudocolor plot with convex polygons.
  
  Call signature:
  
  ``PColorMeshItem([x, y,] z, **kwargs)``
  
  x and y can be used to specify the corners of the quadrilaterals.
  z must be used to specified to color of the quadrilaterals.
  
  Parameters
  ----------
  x, y : np.ndarray, optional, default None
      2D array containing the coordinates of the polygons
  z : np.ndarray
      2D array containing the value which will be mapped into the polygons
      colors.
      If x and y is None, the polygons will be displaced on a grid
      otherwise x and y will be used as polygons vertices coordinates as::
  
          (x[i+1, j], y[i+1, j])           (x[i+1, j+1], y[i+1, j+1])
                              +---------+
                              | z[i, j] |
                              +---------+
              (x[i, j], y[i, j])           (x[i, j+1], y[i, j+1])
  
      "ASCII from: <https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.pyplot.pcolormesh.html>".
  colorMap : pyqtgraph.ColorMap
      Colormap used to map the z value to colors.
      default ``pyqtgraph.colormap.get('viridis')``
  levels: tuple, optional, default None
      Sets the minimum and maximum values to be represented by the colormap (min, max). 
      Values outside this range will be clipped to the colors representing min or max.
      ``None`` disables the limits, meaning that the colormap will autoscale 
      the next time ``setData()`` is called with new data.
  enableAutoLevels: bool, optional, default True
      Causes the colormap levels to autoscale whenever ``setData()`` is called. 
      It is possible to override this value on a per-change-basis by using the
      ``autoLevels`` keyword argument when calling ``setData()``.
      If ``enableAutoLevels==False`` and ``levels==None``, autoscaling will be 
      performed once when the first z data is supplied. 
  edgecolors : dict, optional
      The color of the edges of the polygons.
      Default None means no edges.
      Only cosmetic pens are supported.
      The dict may contains any arguments accepted by :func:`mkColor() <pyqtgraph.mkColor>`.
      Example: ``mkPen(color='w', width=2)``
  antialiasing : bool, default False
      Whether to draw edgelines with antialiasing.
      Note that if edgecolors is None, antialiasing is always False.
docstr_tok: ["Create","a","pseudocolor","plot","with","convex","polygons",".","Call","signature",":","``","PColorMeshItem","(","[","x",",","y",",","]","z",",","*","*","kwargs",")","``","x","and","y","can","be","used","to","specify","the","corners","of","the","quadrilaterals",".","z","must","be","used","to","specified","to","color","of","the","quadrilaterals",".","Parameters","--","--","--","--","--","x",",","y",":","np.ndarray",",","optional",",","default","None","2D","array","containing","the","coordinates","of","the","polygons","z",":","np.ndarray","2D","array","containing","the","value","which","will","be","mapped","into","the","polygons","colors",".","If","x","and","y","is","None",",","the","polygons","will","be","displaced","on","a","grid","otherwise","x","and","y","will","be","used","as","polygons","vertices","coordinates","as",":",":","(","x","[","i+1",",","j","]",",","y","[","i+1",",","j","]",")","(","x","[","i+1",",","j+1","]",",","y","[","i+1",",","j+1","]",")","+","--","--","--","--","-+","|","z","[","i",",","j","]","|","+","--","--","--","--","-+","(","x","[","i",",","j","]",",","y","[","i",",","j","]",")","(","x","[","i",",","j+1","]",",","y","[","i",",","j+1","]",")","``","ASCII","from",":","<","https",":","\/\/matplotlib.org\/3.2.1\/api\/_as_gen\/matplotlib.pyplot.pcolormesh.html",">","''",".","colorMap",":","pyqtgraph.ColorMap","Colormap","used","to","map","the","z","value","to","colors",".","default","``","pyqtgraph.colormap.get","(","'viridis","'",")","``","levels",":","tuple",",","optional",",","default","None","Sets","the","minimum","and","maximum","values","to","be","represented","by","the","colormap","(","min",",","max",")",".","Values","outside","this","range","will","be","clipped","to","the","colors","representing","min","or","max",".","``","None","``","disables","the","limits",",","meaning","that","the","colormap","will","autoscale","the","next","time","``","setData","(",")","``","is","called","with","new","data",".","enableAutoLevels",":","bool",",","optional",",","default","True","Causes","the","colormap","levels","to","autoscale","whenever","``","setData","(",")","``","is","called",".","It","is","possible","to","override","this","value","on","a","per-change-basis","by","using","the","``","autoLevels","``","keyword","argument","when","calling","``","setData","(",")","``",".","If","``","enableAutoLevels==False","``","and","``","levels==None","``",",","autoscaling","will","be","performed","once","when","the","first","z","data","is","supplied",".","edgecolors",":","dict",",","optional","The","color","of","the","edges","of","the","polygons",".","Default","None","means","no","edges",".","Only","cosmetic","pens","are","supported",".","The","dict","may","contains","any","arguments","accepted","by",":","func",":","`","mkColor","(",")","<","pyqtgraph.mkColor",">","`",".","Example",":","``","mkPen","(","color=","'","w","'",",","width=2",")","``","antialiasing",":","bool",",","default","False","Whether","to","draw","edgelines","with","antialiasing",".","Note","that","if","edgecolors","is","None",",","antialiasing","is","always","False","."]
code: def __init__(self, *args, **kwargs):
      """
      Create a pseudocolor plot with convex polygons.
  
      Call signature:
  
      ``PColorMeshItem([x, y,] z, **kwargs)``
  
      x and y can be used to specify the corners of the quadrilaterals.
      z must be used to specified to color of the quadrilaterals.
  
      Parameters
      ----------
      x, y : np.ndarray, optional, default None
          2D array containing the coordinates of the polygons
      z : np.ndarray
          2D array containing the value which will be mapped into the polygons
          colors.
          If x and y is None, the polygons will be displaced on a grid
          otherwise x and y will be used as polygons vertices coordinates as::
  
              (x[i+1, j], y[i+1, j])           (x[i+1, j+1], y[i+1, j+1])
                                  +---------+
                                  | z[i, j] |
                                  +---------+
                  (x[i, j], y[i, j])           (x[i, j+1], y[i, j+1])
  
          "ASCII from: <https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.pyplot.pcolormesh.html>".
      colorMap : pyqtgraph.ColorMap
          Colormap used to map the z value to colors.
          default ``pyqtgraph.colormap.get('viridis')``
      levels: tuple, optional, default None
          Sets the minimum and maximum values to be represented by the colormap (min, max).
          Values outside this range will be clipped to the colors representing min or max.
          ``None`` disables the limits, meaning that the colormap will autoscale
          the next time ``setData()`` is called with new data.
      enableAutoLevels: bool, optional, default True
          Causes the colormap levels to autoscale whenever ``setData()`` is called.
          It is possible to override this value on a per-change-basis by using the
          ``autoLevels`` keyword argument when calling ``setData()``.
          If ``enableAutoLevels==False`` and ``levels==None``, autoscaling will be
          performed once when the first z data is supplied.
      edgecolors : dict, optional
          The color of the edges of the polygons.
          Default None means no edges.
          Only cosmetic pens are supported.
          The dict may contains any arguments accepted by :func:`mkColor() <pyqtgraph.mkColor>`.
          Example: ``mkPen(color='w', width=2)``
      antialiasing : bool, default False
          Whether to draw edgelines with antialiasing.
          Note that if edgecolors is None, antialiasing is always False.
      """
  
      GraphicsObject.__init__(self)
  
      self.qpicture = None  ## rendered picture for display
      self.x = None
      self.y = None
      self.z = None
      self._dataBounds = None
  
      self.edgecolors = kwargs.get("edgecolors", None)
      if self.edgecolors is not None:
          self.edgecolors = fn.mkPen(self.edgecolors)
          # force the pen to be cosmetic. see discussion in
          # https://github.com/pyqtgraph/pyqtgraph/pull/2586
          self.edgecolors.setCosmetic(True)
      self.antialiasing = kwargs.get("antialiasing", False)
      self.levels = kwargs.get("levels", None)
      self._defaultAutoLevels = kwargs.get("enableAutoLevels", True)
  
      if "colorMap" in kwargs:
          cmap = kwargs.get("colorMap")
          if not isinstance(cmap, colormap.ColorMap):
              raise ValueError(
                  "colorMap argument must be a ColorMap instance"
              )
          self.cmap = cmap
      else:
          self.cmap = colormap.get("viridis")
  
      self.lut_qcolor = self.cmap.getLookupTable(
          nPts=256, mode=self.cmap.QCOLOR
      )
  
      self.quads = QuadInstances()
  
      # If some data have been sent we directly display it
      if len(args) > 0:
          self.setData(*args)
  
imports: import numpy
  from ..None import Qt, colormap
  from ..None import functions
  from ..Qt import QtCore, QtGui
  from .GraphicsObject import GraphicsObject
label_desc: Use image node_id 1 to create a new PColorMeshItem object from inherited base classes: GraphicsObject with example: obj = PColorMeshItem()