Ganesh V wrote:
I have a problem with contour plots. See the two plots at
The names show how they are generated. It's the same data obviously. Why the difference. I am dealing with a 161*241 grid and followed instructions given in the 3D plotting with matplotlib cookbook page of scipy.org <http://scipy.org>. Any parameter to be changed ? MATLAB keeps crashing like hell.. I want to get rid of it asap !!
Offhand, it looks like maybe you reshaped your 161*241 into a 241*161 so that it is all scrambled up. Are you taking into account the fact that Matlab stores matrices in Fortran order (first index increases fastest) and numpy by default in C order (last index increases fastest)? One way to check your array is by plotting slices through it: e.g., "plot(A[:,100])" and "plot(A[60,:])". But you really have not provided much information to go on. The best way to get help on something like this is to provide a small self-contained script, generating its own data, that shows the problem. Specify what matplotlib version you are using and on what kind of machine. Update matplotlib if it is not current (although in the present case I am pretty sure that the problem is the input you are giving contourf, not a problem with any past version of it). Also please look at examples/contour_demo.py and examples/contourf_demo.py from the matplotlib distribution, and verify that you can run them and understand them.