Re: [Matplotlib-users] plotting array with inf

2008-08-06 Thread Pierre GM
On Wednesday 06 August 2008 09:24:18 Michael Droettboom wrote: > (I don't know if the > new masked arrays have a C API we could use -- the old ones apparently > didn't.) They don't. I thought about it before, but decided to forget about it until I could find a job where I could learn C and foc

Re: [Matplotlib-users] plotting array with inf

2008-08-06 Thread Michael Droettboom
Eric Firing wrote: > John Hunter wrote: > >> On Tue, Aug 5, 2008 at 3:46 PM, Mark Bakker <[EMAIL PROTECTED]> wrote: >> >> >>> But if I replace the Inf by a nan: y[2] = np.nan, then it plots fine. >>> >>> I know, I know, I can do this with masked arrays, but it cannot be that hard >>> to mak

Re: [Matplotlib-users] plotting array with inf

2008-08-06 Thread Alan G Isaac
On Tue, 5 Aug 2008, John Hunter apparently wrote: > Although intuitively I think of inf as very different from nan, my > default is to go with matlab like behavior in the absence > of compelling a argument otherwise. gnuplot also ignores them. (I am not arguing this is the correct behavior; just

Re: [Matplotlib-users] plotting array with inf

2008-08-06 Thread Mark Bakker
Thanks for stepping up to the plate, Eric. I was asleep on this side of the ocean, so I didn't join in the discussion. >From a functionality point of view, it seems to be a good idea to me not to plot nans (that would actually be impossible) and not to plot infs. The latter are indeed different t

Re: [Matplotlib-users] plotting array with inf

2008-08-05 Thread Eric Firing
John Hunter wrote: > On Tue, Aug 5, 2008 at 7:03 PM, Eric Firing <[EMAIL PROTECTED]> wrote: > >> Matlab ignores it, same as with a nan. > > Although intuitively I think of inf as very different from nan, my > default is to go with matlab like behavior in the absence of > compelling a argument oth

Re: [Matplotlib-users] plotting array with inf

2008-08-05 Thread John Hunter
On Tue, Aug 5, 2008 at 7:03 PM, Eric Firing <[EMAIL PROTECTED]> wrote: > Matlab ignores it, same as with a nan. Although intuitively I think of inf as very different from nan, my default is to go with matlab like behavior in the absence of compelling a argument otherwise. I won't be providing th

Re: [Matplotlib-users] plotting array with inf

2008-08-05 Thread Eric Firing
John Hunter wrote: > On Tue, Aug 5, 2008 at 3:46 PM, Mark Bakker <[EMAIL PROTECTED]> wrote: > >> But if I replace the Inf by a nan: y[2] = np.nan, then it plots fine. >> >> I know, I know, I can do this with masked arrays, but it cannot be that hard >> to make this work correctly, and wouldn't tha

Re: [Matplotlib-users] plotting array with inf

2008-08-05 Thread John Hunter
On Tue, Aug 5, 2008 at 3:46 PM, Mark Bakker <[EMAIL PROTECTED]> wrote: > But if I replace the Inf by a nan: y[2] = np.nan, then it plots fine. > > I know, I know, I can do this with masked arrays, but it cannot be that hard > to make this work correctly, and wouldn't that be much nicer? Desirable?

[Matplotlib-users] plotting array with inf

2008-08-05 Thread Mark Bakker
I have a question about plotting an array with an inf. For example: y = np.array([2.,1.,0,1.,2.]) y = 1.0 / y So y is array([ 0.5, 1. , Inf, 1. , 0.5]) When I plot this, I get an error, of which the last line is: OverflowError: math range error I presume the problem is using the autoscale