|
From: Philipp L. <phi...@tu...> - 2009-03-24 14:34:19
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I want to convert the current figure to a numpy array w/o saving the
image to disk. I need this to convert a matlab function to python, the
original code is:
F = getframe(gcf);
X = frame2im(F);
My current workaround is
h = gcf()
h.savefig('tmp.png')
X = imread('tmp.png')
which is obviously not viable. Also I cannot use a different backend.
TkAgg seems to be the only backend running smoothly with ipython on my
machine.
I tried several functions but I couldn't find the right one. I'm using
matplotlib 0.98.6svn and TkAgg as backend.
Someone knows how to do this neatly?
Cheers
Philipp
- --
Philipp Lies
Max Planck Institute for Biological Cybernetics
Computational Vision & Neuroscience Group
Spemannstr. 41
D-72076 Tuebingen
Germany
Phone: +49-7071-601-1788
Fax: +49-7071-601-552
E-Mail: phi...@tu...
http://www.kyb.mpg.de/bethgegroup
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknI71kACgkQaEa3WOxVB2w7dwCdFakgnE7RuIQniI0lJyNgUXrK
gsYAmwcdesxLdH6/bS5gQ/LVnsk7lCQm
=zhEv
-----END PGP SIGNATURE-----
|