Hello,
I am writing a GUI using GTK+ library. I have a question about axes class 
imshow method memory consumption. If I pass the imshow an array, the resulting 
memory consuption is approximatelly 40 times greater than the array size. If I 
do not add the canvas to a window (in a code below), the memory consuption is 
as expected. Any tips on how to reduce the memory consuption would be very 
appreciated. Configuration and script are below.

os: Windowx XP
matplotlib version: 0.99.1
downloaded from: sourceforge.net

script:
from matplotlib.figure import Figure
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
from pylab import rand
import gtk

window = gtk.Window()
window.connect("destroy", gtk.main_quit)

figure = Figure(figsize=(8,6), dpi=72)
canvas = FigureCanvasGTKAgg(figure)
axes = figure.add_subplot(111)

window.add(canvas)

axes.imshow(rand(1024,1024))
canvas.draw()
window.show_all()

gtk.main()

verbose-helpful output:
$HOME=C:\Documents and Settings\Sensej
CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
loaded rc file C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
matplotlib version 0.99.1
verbose.level helpful
interactive is False
units is False
platform is win32
Using fontManager instance from C:\Documents and 
Settings\Sensej\.matplotlib\fontList.cache
backend GTKAgg version 2.12.1
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
 to Bitstream Vera Sans 
(C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) with 
score of 0.000000

Thank you,
Tomas.

------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to