Until very recently, I had somehow wound up with the impression that pcolormesh
only handles rectilinear coordinate arrays, while pcolor
can handle arbitrarily shaped quadrilaterals.
Apparently, both pcolor and pcolormesh can handle any type of quadrilateral. For example:
import numpy as np
import matplotlib.pyplot as plt
y, x = np.mgrid[:10, :10].astype(float)
x += 0.5 * np.random.random(x.shape)
y += 0.5 * np.random.random(y.shape)
z = np.random.random(x.shape)
fig, axes = plt.subplots(ncols=2)
axes[0].pcolor(x, y, z)
axes[1].pcolormesh(x, y, z)
plt.show()
Given that, is there any effective difference between pcolor
and pcolormesh
other than that pcolor
creates a PolyCollection
and pcolormesh
creates a QuadMesh
?
In other words, is there anything that pcolor
can display that pcolormesh
can’t?
Thanks!
-Joe