[Matplotlib-users] Plotting incomplete data sets

2007-08-29 Thread John Morgan
I have some data, which I'd like to plot using matplotlib. Some of the data
has been flagged by some other software, and I have a boolean array, the
same shape as my original data which tells me which data has been flagged.
What I'd like to do is plot the unflagged data as a single pixels ',' and
flagged data as crosses 'x'.

At the moment I'm plotting all of the data as single pixels, and then
replotting everything as crosses, setting the unflagged data to some
negative number and setting the axes to hide them away off the bottom of the
graph, however this approach is a bit of a pain as you often end up with the
crosses showing up on the bottom of the graph etc.

I'm sure I can get this approach to work but I thought I'd ask if there's
there a more elegant way to achieve the same aim.

Many thanks in advance,

John Morgan
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fatal Python error: deallocating None

2007-04-17 Thread John Morgan
Try as I might I couldn't get your script to crash, so I modified my
code so it was more like yours (see below - I've also made some
cosmetic changes as well). It now runs without crashing :)

If you still want to try and squash this bug I'm happy to do some more
testing but as far as I'm concerned the problem is solved.

Many thanks for the help.

Cheers,

John

PS just in case it's at all relevant, I forgot to mention that for
unrelated reasons I'm using matplotlib with numarray rather than numpy

for ani in range(an1, an2):
if ba1 <= ani: ba1 = ani + 1
for bli in range(ba1, ba2):
if v.blank[ani, bli]:
continue
fig = pylab.figure()
ax = fig.add_subplot(111)
for chi in range(v.nch):
ax.plot(v.iat, v.amp[:,ani,bli,0,chi,0], ',')
ax.plot(v.iat, v.amp[:,ani,bli,0,chi,1], ',')
ax.plot(v.iat, v.amp[:,ani,bli,1,chi,0], ',')
ax.plot(v.iat, v.amp[:,ani,bli,1,chi,1], ',')
baseline = '%02d-%02d' % (ani, bli)
ax.set_title('Baseline ' + baseline)
fig.savefig('TimeSeries' + baseline)
pylab.close()
print 'printing baseline ' + baseline

On 16/04/07, John Hunter <[EMAIL PROTECTED]> wrote:
> On 4/13/07, John Morgan <[EMAIL PROTECTED]> wrote:
> > I'm using matplotlib with Python 2.4.4 to make scatter plots of a
> > reasonably large dataset. Specifically about 200 plots with around
> > 3224 points each. Unfortunately after about 30-40 plots, python
> > invariably crashes with the error:
> >
>
> Could you produce a piece of freestanding code that we can run that
> reproduces the error so we can try and debug it.  Unfortunately, there
> is nothing obviously wrong with your code, which means it is likely to
> be a bug on our side.
>
> Also, please report your versions of matplotlib and numpy, etc.  One
> good way to do this is to create a simple test script and run it with
>
> > python test.py --verbose-helpful
>
> and paste the output here.
>
> To kickstart the process, here is a script that makes 500 figures with
> a similar number of points that *does not crash* on my system.  If you
> are generating figures in batch, make sure you are running in a image
> backend like Agg (for PNG) or PS (for postscript) 
>
> import matplotlib
> matplotlib.use('Agg')
> import numpy
> import pylab
> N = 3224
> ind = numpy.arange(float(N))
> for i in range(500):
> fig = pylab.figure()
> ax = fig.add_subplot(111)
> ax.plot(ind, numpy.random.rand(N), ',')
> ax.plot(ind, numpy.random.rand(N), ',')
> ax.plot(ind, numpy.random.rand(N), ',')
> ax.plot(ind, numpy.random.rand(N), ',')
> ax.set_title('Baseline %d'%i)
> fig.savefig('TimeSeries %d'%i)
> pylab.close()
> print 'printing baseline ', i
>
>
>
> Thanks,
> JDH
>
> JDH
>

-
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/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fatal Python error: deallocating None

2007-04-13 Thread John Morgan
I'm using matplotlib with Python 2.4.4 to make scatter plots of a
reasonably large dataset. Specifically about 200 plots with around
3224 points each. Unfortunately after about 30-40 plots, python
invariably crashes with the error:

Fatal Python error: deallocating None
Aborted

below is the code which is causing the crash, I've tried it with
various backends with the same results.

Any ideas how to avoid this? Many thanks in advance,

John
for ani in range(an1, an2):
if ba1 <= ani: ba1 = ani + 1
for bli in range(ba1, ba2):
if v.blank[ani, bli]:
continue
for chi in range(v.nch):
plot(v.iat, v.amp[:,ani,bli,0,chi,0], ',')
plot(v.iat, v.amp[:,ani,bli,0,chi,1], ',')
plot(v.iat, v.amp[:,ani,bli,1,chi,0], ',')
plot(v.iat, v.amp[:,ani,bli,1,chi,1], ',')
title('Baseline ' + str(ani) + ',' + str(bli))
savefig('TimeSeries' + str(ani) + '-' + str(bli))
close()
print 'printing baseline ' + str(ani) + '/' + str(bli)

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users