I don't know what is matplotlib's policy concerning modifying input data. Here, X and Y may be modified, as ravel does not always copy the data. Is there any chance pcolor may change the user's data ?