From: Garry W. <Gar...@ne...> - 2010-11-10 11:43:30
|
John, OK by looking at matplotlib.rcParams['backend'] I've been able to diagnose this a little more. When the backend is 'WXAgg' everything looks fine. The axes have (0,0) where you would expect and the data is plotted correctly. However, when the backend is 'MacOSX' the axes again have (0,0) where you would expect but the data is plotted so it is flipped vertically (i.e. what is at the top is at the bottom, and vice versa). It doesn't look like an issue between python and ipython, or at least I don't seem to have been able to reproduce it tonight I'm using matplotlib version 0.99.1.1. Is this likely to be fixed in V1.0? I haven't upgraded to the latest enthought distribution because I had some problems with the binary extension libraries I have written ... I ought to sort it out but I've got a bit of deadline approaching and I'd prefer to leave it til later > On Tue, Nov 9, 2010 at 4:33 PM, Garry Willgoose > <Gar...@ne...> wrote: >> I'm using the following code to plot some grided data >> >> fig1=pylab.figure() >> contents1=fig1.add_subplot(111) >> stuff=contents1.imshow(mydata,origin='lower',aspect='equal') >> >> and I find that if I launch the code with 'ipython' the data looks as expected but if I use 'python' then the x-axis annotations are OK but the data is still plotted with the origin in the top left hand corner. I'm using the enthought 6.1 distribution and the version of matplotlib and pylab imported in both cases is the same. I guess one indicator of a major difference is that ipython has the icon bar for the plot at the bottom of the screen but python has the icon bar at the top of the screen. Any clues ... I'd happily just use ipython but I distribute the code to others so I'd like to get it sorted. > > Sounds like a backend problem (see > http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend > and http://matplotlib.sourceforge.net/users/customizing.html) > > First thing you'll want to do is put > > import matplotlib > print matplotlib.rcParams['backend'] > > at the top of your script and run it in both environments and report > what you find. My guess is one of the environments has a backend that > does not support the image origin argument. > > JDH |