Re: [Matplotlib-users] plt.show() - what does it do under the hood?

2011-08-29 Thread Benjamin Root
On Mon, Aug 29, 2011 at 10:26 PM, Trevor J Christensen < tre...@jcmanagement.net> wrote: > I have a number of questions, but I'll start with one. Consider the > following code: > > import matplotlib as mpl > import matplotlib.pyplot as plt > import numpy as np > x = np.arange(1, 6) > plt.plot(x,

[Matplotlib-users] plt.show() - what does it do under the hood?

2011-08-29 Thread Trevor J Christensen
I have a number of questions, but I'll start with one. Consider the following code: import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np x = np.arange(1, 6) plt.plot(x, x*1.5) plt.show() s = raw_input('Enter anything to continue:') plt.show() print 'The end' Ques

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

Re: [Matplotlib-users] Division gotcha?

2011-08-29 Thread Benjamin Root
On Sun, Aug 28, 2011 at 3:03 PM, Bruce Ford wrote: > Getting a strange result trying to divide two 3d arrays. I am getting > a matrix of NaNs regardless of how I divide and I can't determine why. > > #opened a NetCDF file using python-netcdf4 > > var1 = nc_file.variables['var1'] ###shape = [31,1

Re: [Matplotlib-users] numpy datetime64 plans?

2011-08-29 Thread John Hunter
On Mon, Aug 29, 2011 at 2:56 PM, Mark Bakker wrote: > Hello List, > > Does anybody know of any plans to include support for the new datetime64 > data type in numpy? If this is the new numpy standard for doing dates and > times, it would be great if it would work with plot_date, for example. > > Ju

[Matplotlib-users] numpy datetime64 plans?

2011-08-29 Thread Mark Bakker
Hello List, Does anybody know of any plans to include support for the new datetime64 data type in numpy? If this is the new numpy standard for doing dates and times, it would be great if it would work with plot_date, for example. Just wondering (but boy, would I do a little dance when all this da

Re: [Matplotlib-users] Highlight values outside colorbar limits

2011-08-29 Thread Eric Firing
On 08/29/2011 07:40 AM, Benjamin Root wrote: > > > On Mon, Aug 29, 2011 at 12:30 PM, Eric Firing > wrote: > > On 08/29/2011 05:44 AM, Benjamin Root wrote: > > On Mon, Aug 29, 2011 at 9:59 AM, James McMurray > mailto:jamesmc...@gmail.com> > >

Re: [Matplotlib-users] Highlight values outside colorbar limits

2011-08-29 Thread Benjamin Root
On Mon, Aug 29, 2011 at 12:30 PM, Eric Firing wrote: > On 08/29/2011 05:44 AM, Benjamin Root wrote: > > On Mon, Aug 29, 2011 at 9:59 AM, James McMurray > > wrote: > > > > Okay, so using cm.set_over() and set_under works, but is there any > > way of adding the

Re: [Matplotlib-users] Highlight values outside colorbar limits

2011-08-29 Thread Eric Firing
On 08/29/2011 05:44 AM, Benjamin Root wrote: > On Mon, Aug 29, 2011 at 9:59 AM, James McMurray > wrote: > > Okay, so using cm.set_over() and set_under works, but is there any > way of adding the set colors to the edges of the colorbar? > > > > This example shou

Re: [Matplotlib-users] Division gotcha?

2011-08-29 Thread Bruce Ford
Closing the loop...I found the difficulty and applied this: var = np.nan_to_num(np.divide(var1,var2)) See this page: http://psaffrey.wordpress.com/2010/07/30/numpy-and-nan-again/ --- Bruce W. Ford Clear Science, Inc. br...@clearscienceinc.com On Sun, Au

Re: [Matplotlib-users] Highlight values outside colorbar limits

2011-08-29 Thread Benjamin Root
On Mon, Aug 29, 2011 at 9:59 AM, James McMurray wrote: > Okay, so using cm.set_over() and set_under works, but is there any way of > adding the set colors to the edges of the colorbar? > > > This example should do what you want: http://matplotlib.sourceforge.net/examples/api/colorbar_only.html I

Re: [Matplotlib-users] Highlight values outside colorbar limits

2011-08-29 Thread James McMurray
Okay, so using cm.set_over() and set_under works, but is there any way of adding the set colors to the edges of the colorbar? On 29 August 2011 15:47, James McMurray wrote: > Hi, > > Is it possible to color values outside the colorbar limits in a different > color than the colorbar itself. So fo

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-29 Thread mdekauwe
Can you describe what you want to do? So you now want a histogram? surfcast23 wrote: > > Sorry everyone I totally missed something very important. What I need to > do is first bin the masses(which I don't know how to do). > > Chelonian wrote: >> >> On Thu, Aug 25, 2011 at 10:01 PM, surfcast2

[Matplotlib-users] Highlight values outside colorbar limits

2011-08-29 Thread James McMurray
Hi, Is it possible to color values outside the colorbar limits in a different color than the colorbar itself. So for example, an otherwise greyscale plot could have the values outside the upperlimit in blue and those below the lower limit in red, so that these points are not confused with the legi