Thank you very much Pierre! You made me discover boolean index (numpy is fantastic !) In the mean time, I now understand the purpose of maskedarray that I totally missed at a first sight.
Thanks to all of you, David Pierre GM a écrit : > On Sunday 10 February 2008 12:40:38 David Trémouilles wrote: > >> I have a slightly different objective: I just want to remove outliers >> from my curves. I think I will still play with maskedarray and used the >> compressed() function before 'sending' to matplotlib. >> Any comments on that, any other idea? > > So, you have two arrays x and y, with missing values in y that you don't want > to plot ? > Assuming that your arrays are 1D, you can try something like: > plot(x[logical_not(y.mask)], y.compressed()) > in order to ensure that the x and y to be plotted have the same size. > > Note that in this simple case, you don't need masked arrays, you just want to > plot point satisfying a given condition, right ? > So: > condition = (y>=min_value) & (y<= max_value) > plot(x[condition],y[condition]) > will give the same results. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users