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 or something like that to set
the data limits.

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?

Mark
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to