matplotlib question: OverflowError: Allocated too many blocks

R

Ray

hi,
i'm using matplotlib to generate chart from audio wave file, and I had a problem with it.

test code as:

from scipy.io import wavfile
import matplotlib.pyplot as plt
rate, x = wavfile.read('test2.wav')
plt.plot(x)
plt.savefig('test2.png')

the len of x= 19531840 (as len(x) )
matplotlib give exception: OverflowError: Allocated too many blocks

if I display it by:
plt.draw()
plt.show()

everything works fine. it seems I just can't save the output to a file.
I know if I reduce the figsize would make it work. [aka plt.subplots(figsize=(5,2)) ] but this is not what I need. I need to generate the large chart. (depends on size of input file)

anyone know if there's another way to "save" big output file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top