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.