From: Armando Serrano Lombillo <arserlom@gm...>  20070718 10:56:20

Yes! matplotlib is beautiful. Thanks everybody for your help. On 7/18/07, Angus McMorland <amcmorl@...> wrote: > > Hi Armando, > > On 18/07/07, Armando Serrano Lombillo <arserlom@...> wrote: > > Hello, I have a question. > > > > Let's say I have the following data: > > [1,3,6,1,2,0,0,0,0,1,4,7,9,4,2,4,6,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,6,7,8] > > which I want to plot, but I want to omit the zeros, so I would like to > do > > something like: > > plot(range(1,6), [1,3,6,1,2], 'b') > > plot(range(10,18), [1,4,7,9,4,2,4,6], 'b') > > plot(range(30,36), [1,3,5,6,7,8], 'b') > > savefig('filtered.eps') > > > > Is there an elegant way of doing this? > > Do masked arrays achieve what you want? > > from numpy.core import ma > data = n.array > ([1,3,6,1,2,0,0,0,0,1,4,7,9,4,2,4,6,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,6,7,8]) > masked_data = ma.masked_array(data, mask=(dat==0)) > plot(masked_data) > > Angus. >  > AJC McMorland, PhD Student > Physiology, University of Auckland > >  > This SF.net email is sponsored by DB2 Express > Download DB2 Express C  the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 