imshow

mdtools.plot.imshow(ax, x, cax=None, xmin=None, xmax=None, ymin=None, ymax=None, xlabel='$x$', ylabel='$y$', cbarlabel='$z$', **kwargs)[source]

Plot two dimensional data as heatmap with matplotlib.axes.Axes.imshow().

Deprecated since version 0.0.0.dev2: Use mdtools.plot.imshow_new() instead.

Parameters:
  • ax (matplotlib.axes.Axes) – The axes to draw to.

  • x (array_like) – 2-dimensional array containing the data to plot.

  • cax (matplotlib.axes.Axes, optional) – The axes to put the colorbar in.

  • xmin (scalar, optional) – Left limit for plotting on x-axis. The left limit may be greater than the right limit, in which case the tick values will show up in decreasing order. Default is None, which means set the limit automatically.

  • xmax (float, optional) – Right limit for plotting on x-axis.

  • ymin, ymax (scalar, optional) – Same as xmin and xmax, but for the y-axis.

  • xlabel (str, optional) – Label for the x-axis.

  • ylabel (str, optional) – Label for the y-axis.

  • cbarlabel (str, optional) – Label for the colorbar.

  • kwargs (dict, optional) – Keyword arguments to pass to matplotlib.axes.Axes.imshow(). See there for possible keyword arguments.

Returns:

heatmap (matplotlib.image.AxesImage) – A matplotlib.image.AxesImage.