atompy.for_pcolormesh#

atompy.for_pcolormesh(x, y, z, permuting='x', xmin=None, xmax=None, ymin=None, ymax=None)[source]#

Convert xyz-data such that it can be plotted with matplotlib.pyplot.pcolormesh().

Data should look like

x0 y0 z00
x1 y0 z10
x2 y0 z20
...
xM yN zM0
x0 y1 z01
x1 y1 z11
...
xM yN zMN

Alternatively, y could be permuting before x does (see permuting keyword).

Parameters:
x, y, zndarray

x, y, and z data.

permuting{"x", "y"}, default "x"

Specify which if x or y data permutes first (see example above).

xmin, yminfloat, optional

Specify the lower x (y) limit of the data in fname. Only necessary if the x (y) values in fname are not equally spaced. Alternatively, specify xmax (ymax.

xmax, ymaxfloat, optional

Specify the upper x (y) limit of the data in fname. Only necessary if the x (y) values in fname are not equally spaced. Alternatively, specify xmin (ymin). If xmin (ymin) and xmax (ymin) are specified, xmax (ymax) is not used.

Returns:
outputPcolormeshData

Examples

xedges, yedges, counts = ap.for_pcolormesh(x, y, z)
plt.pcoloremesh(xedges, yedges, counts)