Here are the matplotlib.pyplot.pcolormesh() in Python – coding
|Matplotlib is a library in Python and it’s numerical – mathematical extension NumPy library. Pyplot is state-based interface to Matplotlib module that supplies a MATLAB-like interface.
The pcolormesh() perform in pyplot module of matplotlib library is used to create a pseudocolor plot a non-regular rectangular grid.
Syntax:
matplotlib.pyplot.pcolormesh(*args, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, shading='flat', antialiased=False, data=None, **kwargs)Parameters: This technique settle for the next parameters which are described under:
- C : This parameter comprises the values in 2D array that are to be color-mapped.
- X, Y: These parameter are the coordinates of the quadrilateral corners.
- cmap : This parameter is a colormap occasion or registered colormap title.
- norm : This parameter is the Normalize occasion scales the data values to the canonical colormap range [0, 1] for mapping to colours
- vmin, vmax : These parameter are optionally available in nature and they’re colorbar range.
- alpha : This parameter is a depth of the colour.
- snap : This parameter is used to snap the mesh to pixel boundaries.
- edgecolors : This parameter is the colour of the sides. ‘none’, None, ‘face’, colour, colour sequence
- shading : This parameter is the fill model. It cabe flat or gouraud.
Returns: This returns the next:
- mesh : This returns the matplotlib.collections.QuadMesh
Below examples illustrate the matplotlib.pyplot.pcolormesh() perform in matplotlib.pyplot:
Example #1:
|
Output:
Example #2:
|
Output: