8000 DOC: Added API entry, fixed Legend.get_tightbbox string · matplotlib/matplotlib@55c81e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55c81e4

Browse files
committed
DOC: Added API entry, fixed Legend.get_tightbbox string
1 parent 880f531 commit 55c81e4

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

lib/matplotlib/artist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,14 @@ def get_tightbbox(self, renderer):
262262
263263
Parameters
264264
----------
265-
renderer : RendererBase instance
265+
renderer : `.RendererBase` instance
266266
renderer that will be used to draw the figures (i.e.
267267
``fig.canvas.get_renderer()``)
268268
269269
Returns
270270
-------
271-
`BboxBase` : containing the bounding box (in figure-relative
272-
co-ordinates).
271+
bbox : `.BboxBase`
272+
containing the bounding box (in figure pixel co-ordinates).
273273
"""
274274

275275
bbox = self.get_window_extent(renderer)

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,11 +4107,11 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
41074107
41084108
Parameters
41094109
----------
4110-
renderer : RendererBase instance
4110+
renderer : `.RendererBase` instance
41114111
renderer that will be used to draw the figures (i.e.
41124112
``fig.canvas.get_renderer()``)
41134113
4114-
bbox_extra_artists : list of `Artist` or ``None``
4114+
bbox_extra_artists : list of `.Artist` or ``None``
41154115
List of artists to include in the tight bounding box. If
41164116
``None`` (default), then all artist children of the axes are
41174117
included in the tight bounding box.
@@ -4125,7 +4125,8 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
41254125
41264126
Returns
41274127
-------
4128-
`BboxBase` : containing the bounding box (in relative co-ordinates).
4128+
bbox : `.BboxBase`
4129+
containing the bounding box (in figure pixel co-ordinates).
41294130
"""
41304131

41314132
bb = []

lib/matplotlib/figure.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,18 +2007,19 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
20072007
20082008
Parameters
20092009
----------
2010-
renderer : RendererBase instance
2010+
renderer : `.RendererBase` instance
20112011
renderer that will be used to draw the figures (i.e.
20122012
``fig.canvas.get_renderer()``)
20132013
2014-
bbox_extra_artists : list of `Artist` or ``None``
2014+
bbox_extra_artists : list of `.Artist` or ``None``
20152015
List of artists to include in the tight bounding box. If
20162016
``None`` (default), then all artist children of each axes are
20172017
included in the tight bounding box.
20182018
20192019
Returns
20202020
-------
2021-
`BboxBase` : containing the bounding box (in figure co-ordinates).
2021+
bbox : `.BboxBase`
2022+
containing the bounding box (in figure inches).
20222023
"""
20232024

20242025
bb = []

lib/matplotlib/legend.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,20 @@ def get_window_extent(self, *args, **kwargs):
955955
return self._legend_box.get_window_extent(*args, **kwargs)
956956

957957
def get_tightbbox(self, renderer):
958-
'Return extent of the legend.'
958+
"""
959+
Like `.Legend.get_window_extent`, but uses the box for the legend.
960+
961+
Parameters
962+
----------
963+
renderer : `.RendererBase` instance
964+
renderer that will be used to draw the figures (i.e.
965+
``fig.canvas.get_renderer()``)
966+
967+
Returns
968+
-------
969+
`.BboxBase` : containing the bounding box (in figure-relative
970+
co-ordinates).
971+
"""
959972
return self._legend_box.get_window_extent(renderer)
960973

961974
def get_frame_on(self):

0 commit comments

Comments
 (0)
0