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).
This looks worth improving, with checks for all the pcolor-like methods. It is actually OK for either or both of the dimensions of C to be 1 less than the corresponding X and Y dimensions, unless gouraud shading is being used. All this will take a little care, and some tests. At the same time, pcolorfast argument handling might be improved.
Duplicate of #1688?