mplutils.for_pcolormesh#

mplutils.for_pcolormesh(xcenters, ycenters, z, *, iteration_order='x_first', xmin=None, xmax=None, ymin=None, ymax=None)[source]#

Convert xcenters, ycenters, z such that they can be plotted by matplotlib.pyplot.pcolormesh().

See Examples for an example how the arrays are structured.

Parameters:
xcentersarray_like

A flat sequence of x-coordinates, representing the horizontal position of each element in the grid.

If the bins are not all equal in size, xmin or xmax needs to be specified.

ycenters : array_like

A flat sequence of y-coordinates, representing the vertical position of each element in the grid.

If the bins are not all equal in size, ymin or ymax needs to be specified.

zarray_like

A flat sequence of data values corresponding to each (xcenters, ycenters) coordinate

The x, y, and z sequences must all be the same length, where each z[i] corresponds to the position (xcenters[i], ycenters[i]) in a 2D grid.

iteration_order{“x_first”, “y_first”}, default “x_first”

Specify if the outer iteration is along x or y.

xmin, xmax, ymin, ymaxfloat, optional

If x (y) bins do not have constant size, at least one corresponding limit has to be provided.

Note

This does not refer to the limits of the bin centers, but the limits of the bin edges!

Returns:
X, Y, Cndarray

Output formatted to work with matplotlib.pyplot.pcolormesh().