Jupyter Notebook Viewer (original) (raw)
Input Data: 2D Arrays or Images¶
There are several options for plotting 2D datasets. imshow, pcolor, and pcolormesh have a lot of overlap, at first glance. The image below is meant to clarify that somewhat.

In short, imshow can interpolate and display large arrays very quickly, while pcolormesh and pcolor are much slower, but can handle flexible (i.e. more than just rectangular) arrangements of cells.
We won't dwell too much on the differences and overlaps here. They have overlapping capabilities, but different default behavior because their primary use-cases are a bit different (there's also matshow, which is imshow with different defaults).
Instead we'll focus on what they have in common.
imshow, pcolor, pcolormesh, scatter, and any other Matplotlib plotting methods that map a range of data values onto a colormap will return artists that are instances of ScalarMappable. In practice, what that means is a) you can display a colorbar for them, and b) they share several keyword arguments.