Pylab causes crash if not given some idle time using raw_input()?

Dear all,

I just again faced a problem appearing whenever I quickly generate multiple plots (using Windows XP, Python 2.5, matplotlib 0.98.1):

pylab.ion()
for n in range(n_elements):
## print
## print element_symbols[n]+'-'+element_linegroup[n]
## print normalized_mass_fractions[:,:,n]
    pylab.figure()
## pylab.imshow(normalized_mass_fractions[:,:,n])
    pylab.pcolor(normalized_mass_fractions[:,:,n])
    pylab.title(element_symbols[n]+'-'+element_linegroup[n])
    pylab.draw()
## raw_input()

My script crashes if and only if I do not have a raw_input at the end, windows points towards:

AppName: pythonw.exe AppVer: 0.0.0.0 ModName: tk84.dll
ModVer: 8.4.2.12 Offset: 0000bddf

Most probably I am just abusing python/pylab, or maybe this is a known issue?

Cheers, Gerd

···

--
Dr. Gerd Wellenreuther
beamline scientist P06 "Hard X-Ray Microprobe/Nanoprobe"
Petra III project
HASYLAB at DESY
Notkestr. 85
22603 Hamburg

Tel.: + 49 40 8998 5701

Dear all,

just noticed that the problem also happens with the raw_input - I guess I just closed the figure-windows during the raw_input-call. Closing the figures (either manually or with pylab.close()) prevents the crash, but I wonder why? Memory should not be an issue, python crashes when only using 100MB.

Cheers, Gerd

Wellenreuther, Gerd wrote:

···

Dear all,

I just again faced a problem appearing whenever I quickly generate multiple plots (using Windows XP, Python 2.5, matplotlib 0.98.1):

pylab.ion()
for n in range(n_elements):
## print
## print element_symbols[n]+'-'+element_linegroup[n]
## print normalized_mass_fractions[:,:,n]
    pylab.figure()
## pylab.imshow(normalized_mass_fractions[:,:,n])
    pylab.pcolor(normalized_mass_fractions[:,:,n])
    pylab.title(element_symbols[n]+'-'+element_linegroup[n])
    pylab.draw()
## raw_input()

My script crashes if and only if I do not have a raw_input at the end, windows points towards:

AppName: pythonw.exe AppVer: 0.0.0.0 ModName: tk84.dll
ModVer: 8.4.2.12 Offset: 0000bddf

Most probably I am just abusing python/pylab, or maybe this is a known issue?

Cheers, Gerd