SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(5)
2
(4)
3
4
(9)
5
(4)
6
(9)
7
(13)
8
(11)
9
(7)
10
(7)
11
(22)
12
(19)
13
(11)
14
(20)
15
(21)
16
(1)
17
(1)
18
(8)
19
(3)
20
(5)
21
(5)
22
(9)
23
(3)
24
(3)
25
(14)
26
(12)
27
(29)
28
(18)
29
(11)
30
(2)

Showing 5 results of 5

From: Daehyok S. <sd...@gm...> - 2005年04月01日 21:01:21
While using matplotlib 0.74 in Mandrake 10.1, I got the following warning.
Would you tell me how to avoid the warning message? Thanks.
>>> pylab.plot([1,2,3,4])
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:533:
DeprecationWarning:
 getattr(self, callback)
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:523:
DeprecationWarning:
 self.append_space()
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:536:
DeprecationWarning:
 self.append_space()
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:539:
DeprecationWarning:
 self.append_widget(self.message, None, None)
[<matplotlib.lines.Line2D instance at 0x406e674c>]
-- 
Daehyok Shin
Geography Department
University of North Carolina-Chapel Hill
USA
From: Humufr <hu...@ya...> - 2005年04月01日 15:53:30
Ok I didn't know that it was a well known problem, thanks to point me a 
solution. The image is grayscale because it's a fits file. I'm doing 
some publicity for matplotlib in my department and someone ask me to 
plot this peculiar image but we became to have some big CCD (or ccd 
mosaic) or create some simulation with big CCD.
It's good idea if that will be possible to have inside matplotlib the 
down-sampling :)
I saw in the same time a small problem with matshow. I thought that this 
command preserve the aspect of the figure. It's true but not if you're 
using the colorbar() function at the same time.
 
thanks,
N.
a=zeros((20,20))
a[3,4] = 4 # if the image is totally flat colorbar give an error
matshow(a)
colorbar()
John Hunter wrote:
>>>>>>"Humufr" == Humufr <hu...@ya...> writes:
>>>>>> 
>>>>>>
>
> Humufr> Hi, on a pc with linux and 512M of
> Humufr> RAM, I have a problem of memory when I'm using matplotlib.
>
> Humufr> from pylab import * imshow(zeros((2000,2000))) show()
>
> Humufr> is working but:
>
> Humufr> from pylab import * imshow(zeros((4000,4000))) show()
>
>Yes this is a problem. The image module turns everything into an rgba
>matrix under the hood. This was an early design decision to conserve
>programmer resources (my time) over memory and CPU. We made it with
>the knowledge that this couldn't last forever, since someone (you
>apparently) would eventually need a grayscale image w/o this overhead.
>Note if you want to colormap this image, then the problem is going to
>be there regardless.
>
>Several releases ago I spent some time hammering on the image module
>looking for CPU performance gains, with some success. Looks like I'll
>have to do the same for memory.....
>
>Note that agg has a built-in limit of 4096x4096 buffers, and your
>display device is likely to be much smaller still. I suggest you
>consider down-sampling your image in numarray before processing
>passing it to imshow. There are a number of people working on
>algorithms to down-sample images (I think Maxim, the agg author is one
>of them, and I think the numarray/stsci people are too). If there is
>a good agg algorithm to do it, it would be nice to expose is in mpl.
>
>JDH
>
> 
>
From: Perry G. <pe...@st...> - 2005年04月01日 15:53:29
It's clear you are running out of memory. The image you are displaying 
is on the order of 64MB in size. While the single array itself isn't 
enough to consume all your memory, it isn't clear what other memory is 
in use, or what your page size is, etc. Matplotlib will create some 
temporaries in the process of scaling arrays for display, so I wouldn't 
be surprised to see this image require a few more times that amount of 
memory.
Perry
On Apr 1, 2005, at 9:51 AM, Humufr wrote:
> 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
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by Demarc:
> A global provider of Threat Management Solutions.
> Download our HomeAdmin security software for free today!
> http://www.demarc.com/info/Sentarus/hamr30
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jdh...@ac...> - 2005年04月01日 15:34:47
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
 Humufr> Hi, on a pc with linux and 512M of
 Humufr> RAM, I have a problem of memory when I'm using matplotlib.
 Humufr> from pylab import * imshow(zeros((2000,2000))) show()
 Humufr> is working but:
 Humufr> from pylab import * imshow(zeros((4000,4000))) show()
Yes this is a problem. The image module turns everything into an rgba
matrix under the hood. This was an early design decision to conserve
programmer resources (my time) over memory and CPU. We made it with
the knowledge that this couldn't last forever, since someone (you
apparently) would eventually need a grayscale image w/o this overhead.
Note if you want to colormap this image, then the problem is going to
be there regardless.
Several releases ago I spent some time hammering on the image module
looking for CPU performance gains, with some success. Looks like I'll
have to do the same for memory.....
Note that agg has a built-in limit of 4096x4096 buffers, and your
display device is likely to be much smaller still. I suggest you
consider down-sampling your image in numarray before processing
passing it to imshow. There are a number of people working on
algorithms to down-sample images (I think Maxim, the agg author is one
of them, and I think the numarray/stsci people are too). If there is
a good agg algorithm to do it, it would be nice to expose is in mpl.
JDH
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

Showing 5 results of 5

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /