On 2013/01/20 1:48 AM, Burak nebioğlu wrote: > Dear Eric , > > below are the results that I get when I see these errors it is also > strange for me but I tried in matlab and it worked with mtlab style I > tried for pcolormesh it works just like matlab it is (99,) (56,) > dimensioned 2 vectors and data is 99*56 matrix
Sorry, I included the () by mistake on the requested dtype and the shape print statements. dtype and shape are attributes, so they don't need parentheses. In any case, you provided enough information for me to test, and I see exactly what you note--except that the bug is in pcolormesh, not pcolor. With either one, an argument sequence (x, y, z) should require that the shape of z be (ny, nx) or (ny-1, nx-2), not the transpose of that. If your present data array has shape (nx, ny), then use pcolormesh(x, y, data.T) and it will be plotted correctly. It may be that matlab is trying to be helpful by doing a transpose automatically if that makes the function arguments seem to fit better, but that is not what we do, or what we would ever want to do. So, regardless of whether you use pcolor or pcolormesh, please use the argument order and shape requirements as described in the docstrings, the API documentation, and the examples. Otherwise you are not likely to get the result you want. I have filed a bug report for this: https://github.com/matplotlib/matplotlib/issues/1688 Eric > > > > > type x <type 'numpy.ndarray'> > X.dtype > > print 'X.dtype',X.dtype() > TypeError: 'numpy.dtype' object is not callable > > print 'X.shape',X.shape() > TypeError: 'tuple' object is not callable > > > type y <type 'numpy.ndarray'> > y.shape > > print 'y.dtype',Y.dtype() > TypeError: 'numpy.dtype' object is not callable > > > print 'y.shape',Y.shape() > TypeError: 'tuple' object is not callable > > type data <type 'numpy.ndarray'> > data.dtype > > print 'data.dtype',reshaped.dtype() > TypeError: 'numpy.dtype' object is not callable > > print 'data.shape',reshaped.shape() > TypeError: 'tuple' object is not callable > > Thank you again > > > > > 2013/1/20 Eric Firing <efir...@hawaii.edu <mailto:efir...@hawaii.edu>> > > print type(x) > print x.dtype() > print x.shape() > > > ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users