If you're just looking for the dimensions of the overall figure in pixels, you can easily access them through other means. E.g:

import matplotlib.pyplot as plt
fig = plt.figure()
_, _, width, height = fig.bbox.extents # <- Extent of the figure in pixels
fig.savefig('temp.png', dpi=fig.dpi) # <- Be sure to specify the dpi!!

Note that you'll have to specify that you want to save the figure at the same DPI it was when you called the extents...

The figure will be saved with whatever default DPI is in your .matplotlibrc, which is commonly different than the default screen dpi (80). 

Hope that helps,
-Joe

On Wed, Sep 29, 2010 at 9:44 AM, Alexander Dietz <alexanderdietz1@googlemail.com> wrote:
Hi,

On Wed, Sep 29, 2010 at 16:00, John Hunter <jdh2358@gmail.com> wrote:
On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz
<Alexander.Dietz72@googlemail.com> wrote:

> print ax.transData.transform((10.0, 20.0))
> [ 576.  432.]


Why do you say it's wrong?  Note that in mpl, (0,0) is (bottom left),
not (upper,left).  So this is saying that the yellow dot at 10,20
(data coords) is 576 pixels up from the bottom and 432 pixels over
from the left.


ok maybe it is. But then I need the size of the entire figure written to a file. How can I find out the pixel-size of the entire figure, inclusive every title, axis, labels...


Thanks
  Alex

 

JDH


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev

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