Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: John Morgan <mojoh81@gm...>  20070413 10:25:26

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 3040 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) 
From: John Hunter <jdh2358@gm...>  20070416 20:30:19

On 4/13/07, John Morgan <mojoh81@...> 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 3040 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 verbosehelpful 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 
From: John Morgan <mojoh81@gm...>  20070417 12:13:39

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 <jdh2358@...> wrote: > On 4/13/07, John Morgan <mojoh81@...> 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 3040 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 verbosehelpful > > 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 > 
From: John Hunter <jdh2358@gm...>  20070417 13:35:33

On 4/17/07, John Morgan <mojoh81@...> wrote: > 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. Since we still don't know if it is even in matplotlib (it could be in numarray) I don't think we can pursue this until we have a minimal script which reproduces the error. If it rears up again, try and isolate it and send us a script. Thanks, JDH 
Sign up for the SourceForge newsletter:
No, thanks