xarray.plot.imshow (original) (raw)

xarray.plot.imshow(darray, *args, x=None, y=None, figsize=None, size=None, aspect=None, ax=None, row=None, col=None, col_wrap=None, xincrease=True, yincrease=True, add_colorbar=None, add_labels=True, vmin=None, vmax=None, cmap=None, center=None, robust=False, extend=None, levels=None, infer_intervals=None, colors=None, subplot_kws=None, cbar_ax=None, cbar_kwargs=None, xscale=None, yscale=None, xticks=None, yticks=None, xlim=None, ylim=None, norm=None, **kwargs)[source]#

Image plot of 2D DataArray.

Wraps matplotlib.pyplot.imshow().

While other plot methods require the DataArray to be strictly two-dimensional, imshow also accepts a 3D array where some dimension can be interpreted as RGB or RGBA color channels and allows this dimension to be specified via the kwarg rgb=.

Unlike matplotlib.pyplot.imshow(), which ignores vmin/vmaxfor RGB(A) data, xarray will use vmin and vmax for RGB(A) data by applying a single scaling factor and offset to all bands. Passing robust=True infers vmin and vmax in the usual way. Additionally the y-axis is not inverted by default, you can restore the matplotlib behavior by setting yincrease=False.

Note

This function needs uniformly spaced coordinates to properly label the axes. Call DataArray.plot() to check.

The pixels are centered on the coordinates. For example, if the coordinate value is 3.2, then the pixels for those coordinates will be centered on 3.2.

Parameters:

Returns:

artist – The same type of primitive artist that the wrapped Matplotlib function returns.