Re: [Matplotlib-users] Trouble with reading 2d array

2011-08-31 Thread Benjamin Root
On Wed, Aug 31, 2011 at 3:50 PM, Alexa Villaume wrote: > 41, 25 > > > Yes, you have it backwards. The first axis of O3 is the rows, while the second axis is the columns. Keep in mind that Python and NumPy follow C array conventions while Matlab (and IDL?) follow Fortran array conventions. So,

Re: [Matplotlib-users] Trouble with reading 2d array

2011-08-31 Thread Benjamin Root
On Wed, Aug 31, 2011 at 3:45 PM, Alexa Villaume wrote: > #Load data in > > O3 = loadtxt('O3arr.txt') > > > #Specify coordinates of the surface > > y=np.arange(-0.25, 6.0, 0.25) #The range of the ionization parameter > > x=np.arange(-1.0, 3.1, 0.1) #The range of the metallcity values > > > #Define

Re: [Matplotlib-users] Trouble with reading 2d array

2011-08-31 Thread Benjamin Root
On Tue, Aug 30, 2011 at 9:47 PM, Alexa Villaume wrote: > Thanks for responding, Ben. I used loadtxt() and I'm still getting a very > strange looking contour plot. I've attached it and maybe that will be > helpful in diagnosing what is wrong with it. > > I have no reason to believe that the data i

Re: [Matplotlib-users] Trouble with reading 2d array

2011-08-29 Thread Benjamin Root
How about Numpy's loadtxt()? Genfromtext is more of a specialty function. Ben Root On Monday, August 29, 2011, Alexa Villaume wrote: > Hi there, > I have a 2d array that I'd like to contour. The plot isn't turning out right and I think it's because the array isn't be read in correctly. > It's a

[Matplotlib-users] Trouble with reading 2d array

2011-08-29 Thread Alexa Villaume
Hi there, I have a 2d array that I'd like to contour. The plot isn't turning out right and I think it's because the array isn't be read in correctly. It's a 25x41 array that is in a text file. I have tried using genfromtxt and the asciitable module to read the data in and neither gives the correc