From: Jeremy Lewi [mailto:jl...@intellisis.com] 
Sent: Friday, September 17, 2010 17:38

 

Is there a way to get the size of the bounding box for the axes which includes
the axes labels and tick marks? It looks like Axes.get_position/set_position
refers to the inner position (i.e the actual plot area).

Perhaps you could use the get_tightbbox() method possessed by Figure and Axes
instances, although you need to tell it what renderer to use. If you've
already drawn the figure in a GUI window, the method employed by
FigureCanvasBase.print_figure in backend_bases.py might work:

fig = plt.gcf()
bbox = fig.get_tightbbox(fig._cachedRenderer)

You can then get the measurements using such properties and methods as these:

left, bottom, width, height = bbox.bounds
left, bottom, right, top = bbox.get_points().flatten()

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to