<p dir="auto">The function "pcolormesh(X,Y,C)" will raise no ValueError, if the shapes of C and X,Y are not compatible. Instead a wrong plot will be produced. I suggest to raise a ValueError, if C has a shape of (n,m) and the shapes of  X and Y or neither (n,m) nor (n+1,m+1).</p>
<p dir="auto">Both pcolor and pcolormesh use _pcolorargs to process the x, y, z arguments.  This handles the cases where x, y are not present, and the cases where one or both of x, y are 1-D rather than 2-D, but it does not check that they are consistent with z.shape.  Pcolor will raise an exception if they are not, but pcolormesh will simply make an incorrect plot.</p>