Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## Re: [Matplotlib-users] Axes outer position - amount of space for axeslabels

 Re: [Matplotlib-users] Axes outer position - amount of space for axeslabels From: Stan West - 2010-09-23 18:20:30 Attachments: Message as HTML ```From: Jeremy Lewi [mailto:jlewi@...] 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() ```

 [Matplotlib-users] Axes outer position - amount of space for axes labels From: Jeremy Lewi - 2010-09-17 21:56:22 Attachments: Message as HTML ```HI, 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). In matlab (http://www.mathworks.com/help/techdoc/ref/axes_props.html) this was the outer and inner position of an axes. I would like to get the outer position (i.e the yellow box in http://www.mathworks.com/help/techdoc/ref/axes_props.html) Thanks Jeremy Jeremy Lewi Engineering Scientist The Intellisis Corporation jlewi@... ```
 Re: [Matplotlib-users] Axes outer position - amount of space for axes labels From: Benjamin Root - 2010-09-18 01:52:06 Attachments: Message as HTML ```On Fri, Sep 17, 2010 at 4:37 PM, Jeremy Lewi wrote: > HI, > > > > 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). > > > > > > In matlab (http://www.mathworks.com/help/techdoc/ref/axes_props.html) this > was the outer and inner position of an axes. I would like to get the outer > position (i.e the yellow box in > http://www.mathworks.com/help/techdoc/ref/axes_props.html) > > > > Thanks > > Jeremy > > > > Jeremy Lewi > > Engineering Scientist > > The Intellisis Corporation > > jlewi@... > > > > Jeremy, Yes, get/set_position refers to the position of the plot area within a particular axes area in a figure. I am not exactly aware of how one determines its outer boundary box, because there really isn't an outer box. Everything within an axes area is plotted within coordinates of 0 to 1. The plot box is set typically at 0.125 to 0.9. Axes labels are then draw as an offset relative to the plot area. This can cause the axes labels and figure titles to overlap each other in neighboring subplots if they get too big. Tony Yu did make some code to help deal with display issues surrounding the lack of a constrained outer box. See this link for some discussion of it and the code. Maybe it can help you with whatever you need. http://permalink.gmane.org/gmane.comp.python.matplotlib.general/24652 I hope that helps! Ben Root ```
 Re: [Matplotlib-users] Axes outer position - amount of space for axeslabels From: Stan West - 2010-09-23 18:20:30 Attachments: Message as HTML ```From: Jeremy Lewi [mailto:jlewi@...] 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() ```