When I try to save a pylab plot (either from the GUI or with pylab.savefig
), I get the error at the bottom.
A minimal script that demonstrates the problem is:
import pylab
pylab.savefig("foo.png")
A Google search for IndexError: Unexpected SeqBase<T> length
did produce some results, none of them hinting how to solve the problem.
I run the latest pylab (matplotlib version 1.1.0) with Python 2.6.8 on CygWin (CYGWIN_NT-6.1 1.7.17(0.262/5/3)).
Anyone knows how to get pylab.savefig
to work?
$ python demonstrate_Unexpected_SeqBase_error.py
Traceback (most recent call last):
File "demonstrate_Unexpected_SeqBase_error.py", line 2, in <module>
pylab.savefig("foo.png")
File "/usr/lib/python2.6/site-packages/matplotlib/pyplot.py", line 471, in savefig
return fig.savefig(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 1172, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/matplotlib/backend_bases.py", line 2017, in print_figure
**kwargs)
File "/usr/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py", line 451, in print_png
_png.write_png(renderer._renderer.buffer_rgba(0, 0),
IndexError: Unexpected SeqBase<T> length.