matplotlib question: OverflowError: Allocated too many blocks

Ray rui.vapps at gmail.com
Fri Sep 20 13:17:56 EDT 2013


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?



More information about the Python-list mailing list