PColorMeshItem#
- class pyqtgraph.PColorMeshItem(*args, **kwargs)[source]#
Bases:
GraphicsObject
- __init__(*args, **kwargs)[source]#
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 (
numpy.ndarray
, optional, defaultNone
) – 2D array containing the coordinates of the polygonsy (
numpy.ndarray
, optional, defaultNone
) – 2D array containing the coordinates of the polygonsz (
numpy.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. defaultpyqtgraph.colormap.get('viridis')
levels (
tuple
, optional, defaultNone
) – 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 timesetData()
is called with new data.enableAutoLevels (
bool
, optional, defaultTrue
) – Causes the colormap levels to autoscale wheneversetData()
is called. It is possible to override this value on a per-change-basis by using theautoLevels
keyword argument when callingsetData()
. IfenableAutoLevels==False
andlevels==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 bymkColor()
. Example:mkPen(color='w', width=2)
antialiasing (
bool
, defaultFalse
) – Whether to draw edgelines with antialiasing. Note that if edgecolors is None, antialiasing is always False.
- getLevels()[source]#
Returns a tuple containing the current level settings. See
setLevels()
. The format is(low, high)
.
- setData(*args, **kwargs)[source]#
Set the data to be drawn.
- Parameters:
x (
numpy.ndarray
, optional, defaultNone
) – 2D array containing the coordinates of the polygonsy (
numpy.ndarray
, optional, defaultNone
) – 2D array containing the coordinates of the polygonsz (
numpy.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>”.
autoLevels (
bool
, optional) – If set, overrides the value ofenableAutoLevels