matplotlib.pyplot.``pcolormesh
(*args, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, shading='flat', antialiased=False, data=None, **kwargs) 创建一个带有不规则矩形网格的伪彩色图
Parameters:
C : array_like
A scalar 2-D array. The values will be color-mapped.
X, Y : array_like, optional
The coordinates of the quadrilateral corners. The quadrilateral for C[i,j]
has corners at:
(X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
+--------+
| C[i,j] |
+--------+
(X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1]),
Note that the column index corresponds to the x-coordinate, and the row index corresponds to y. For details, see the Notes section below.
The dimensions of X and Y should be one greater than those of C. Alternatively, X, Y and C may have equal dimensions, in which case the last row and column of C will be ignored.
If X and/or Y are 1-D arrays or column vectors they will be expanded as needed into the appropriate 2-D arrays, making a rectangular grid.
cmap : str or Colormap
, optional
A Colormap instance or registered colormap name. The colormap maps the C values to colors. Defaults to [rcParams["image.cmap"]](https://matplotlib.org/tutorials/introductory/customizing.html#matplotlib-rcparams)
.
norm : Normalize
, optional
The Normalize instance scales the data values to the canonical colormap range [0, 1] for mapping to colors. By default, the data range is mapped to the colorbar range using linear scaling.
Normalize实例将数据值缩放到用于映射到颜色的规范化colormap范围[0,1]。默认情况下,使用线性缩放将数据范围映射到colorbar范围。
vmin, vmax : scalar, optional, default: None
The colorbar range. If None, suitable min/max values are automatically chosen by the Normalize
instance (defaults to the respective min/max values of C in case of the default linear scaling).
edgecolors : {'none', None, 'face', color, color sequence}, optional
边缘颜色,默认None:
[rcParams["patch.edgecolor"]](https://matplotlib.org/tutorials/introductory/customizing.html#matplotlib-rcparams)
will be used. Note that currently[rcParams["patch.force_edgecolor"]](https://matplotlib.org/tutorials/introductory/customizing.html#matplotlib-rcparams)
has to be True for this to work.The singular form edgecolor works as an alias.
alpha : scalar, optional, default: None
透明度
shading : {'flat', 'gouraud'}, optional
The fill style, Possible values:
填充式样
C[i,j]
.C[i',j']
. The color values of the area in between is interpolated from the corner values. When Gouraud shading is used, edgecolors is ignored.snap : bool, optional, default: False
Whether to snap the mesh to pixel boundaries.
Returns:
mesh : [matplotlib.collections.QuadMesh](https://matplotlib.org/api/collections_api.html#matplotlib.collections.QuadMesh)
手机扫一扫
移动阅读更方便
你可能感兴趣的文章