Axes.pcolor(*args, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, data=None, **kwargs)
[source]
Create a pseudocolor plot with a non-regular rectangular grid.
Call signature:
pcolor([X, Y,] C, **kwargs)
X and Y can be used to specify the corners of the quadrilaterals.
Hint
pcolor()
can be very slow for large arrays. In most cases you should use the similar but much faster pcolormesh
instead. See there for a discussion of the differences.
Parameters: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Other Parameters: |
|
See also
pcolormesh
imshow
imshow
can be a faster alternative.Masked arrays
X, Y and C may be masked arrays. If either C[i, j]
, or one of the vertices surrounding C[i,j]
(X or Y at [i, j], [i+1, j], [i, j+1], [i+1, j+1]
) is masked, nothing is plotted.
Grid orientation
The grid orientation follows the standard matrix convention: An array C with shape (nrows, ncolumns) is plotted with the column number as X and the row number as Y.
Handling of pcolor() end-cases
pcolor()
displays all columns of C if X and Y are not specified, or if X and Y have one more column than C. If X and Y have the same number of columns as C then the last column of C is dropped. Similarly for the rows.
Note: This behavior is different from MATLAB's pcolor()
, which always discards the last row and column of C.
Note
In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]:
Objects passed as data must support item access (data[<arg>]
) and membership test (<arg> in data
).
matplotlib.axes.Axes.pcolor
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.0.0/api/_as_gen/matplotlib.axes.Axes.pcolor.html