Hi Alan,
It seems MaskedArrays are the preferred way to do this. See the
masked_demo.py example.
And while I'm at it, does anyone if there is simple function call which
returns only the unmasked values of a masked array (without filling the
masked values in, but simply returning a shorter sequence)? What is
it? I have my own, but it's not pretty:
import matplotlib.numerix as nx
import matplotlib.numerix.ma as M
def unmasked_values(b):
indices = nx.where(b.mask()==0)
result = M.take(b,indices).filled()[0]
return result
(tested only in numarray)
Cheers!
Andrew
On Jul 11, 2005, at 6:21 PM, Alan G Isaac wrote:
> Is the default handling of nan by plot the "right" one?
> I am accustomed (from GAUSS) to missing values being
> treated as "gaps".
> E.g.,
> x=[nan,2,3,4,5]
> plot(x)
> fails completely. I expect the last 4 numbers to be
> plotted.
> x=[1,2,nan,4,5]
> plot(x)
> plots a single line. I expect two segments and a gap.
>
> fwiw,
> Alan Isaac
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in
> dual
> core and dual graphics technology at this free one hour event hosted
> by HP,
> AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|