atompy.for_imshow#

atompy.for_imshow(x, y, z, permuting='x', origin=None)[source]#

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

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).

origin{"lower", "upper"}, optional

Specify the origin of the imshow-image. If None, use plt.rcParams["image.origin"].

Returns:
outputImshowData

Examples

image, extent = ap.for_imshow(x, y, z)
plt.imshow(image, extent=extent)