From: Humufr <hu...@ya...> - 2005-04-01 15:25:03
|
Hi, on a pc with linux and 512M of RAM, I have a problem of memory when I'm using matplotlib. from pylab import * imshow(zeros((2000,2000))) show() is working but: from pylab import * imshow(zeros((4000,4000))) show() is not. That slow down the computer, it close to be freeze and I obtain this error (the two error message for show() and savefig('test.png') are at the bottom of the mail. (matshow give exactly the same result) It's a big problem, for me at least, because I'm working with some image with 4000x4000 pixels. Thanks, N. Exception in Tkinter callback Traceback (most recent call last): File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__ return self.func(*args) File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", line 140, in resize self.show() File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", line 143, in draw FigureCanvasAgg.draw(self) File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 312, in draw self.figure.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line 395, in draw for a in self.axes: a.draw(renderer) File "/scratch/gruel/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line 1339, in draw im.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/image.py", line 182, in draw im = self.make_image(isUpper) File "/usr/local/lib/python2.4/site-packages/matplotlib/image.py", line 112, in make_image x = self.to_rgba(self._A, self._alpha) File "/usr/local/lib/python2.4/site-packages/matplotlib/cm.py", line 418, in to_rgba return self.cmap(x, alpha) File "/usr/local/lib/python2.4/site-packages/matplotlib/colors.py", line 526, in __call__ rgba = zeros(xa.shape+(4,), Float) File "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 1407, in zeros retarr = NumArray(shape=shape, type=type) MemoryError: Couldn't allocate requested memory I did the same with savefig Traceback (most recent call last): File "test.py", line 12, in ? savefig('test.png') File "/scratch/gruel/usr/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 719, in savefig return fig.savefig(*args, **kwargs) File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line 512, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", line 161, in print_figure agg.print_figure(filename, dpi, facecolor, edgecolor, orientation) File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 375, in print_figure self.draw() File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 312, in draw self.figure.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line 395, in draw for a in self.axes: a.draw(renderer) File "/scratch/gruel/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line 1339, in draw im.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/image.py", line 182, in draw im = self.make_image(isUpper) File "/usr/local/lib/python2.4/site-packages/matplotlib/image.py", line 112, in make_image x = self.to_rgba(self._A, self._alpha) File "/usr/local/lib/python2.4/site-packages/matplotlib/cm.py", line 418, in to_rgba return self.cmap(x, alpha) File "/usr/local/lib/python2.4/site-packages/matplotlib/colors.py", line 526, in __call__ rgba = zeros(xa.shape+(4,), Float) File "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 1407, in zeros retarr = NumArray(shape=shape, type=type) MemoryError: Couldn't allocate requested memory |