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

Skip to content

Commit 68cf458

Browse files
committed
DOC: Added API entry, fixed Legend.get_tightbbox string
1 parent d6c5c7d commit 68cf458

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4099,11 +4099,11 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
40994099
41004100
Parameters
41014101
----------
4102-
renderer : RendererBase instance
4102+
renderer : `.RendererBase` instance
41034103
renderer that will be used to draw the figures (i.e.
41044104
``fig.canvas.get_renderer()``)
41054105
4106-
bbox_extra_artists : list of `Artist` or ``None``
4106+
bbox_extra_artists : list of `.Artist` or ``None``
41074107
List of artists to include in the tight bounding box. If
41084108
``None`` (default), then all artist children of the axes are
41094109
included in the tight bounding box.

lib/matplotlib/figure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,18 +2221,18 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
22212221
22222222
Parameters
22232223
----------
2224-
renderer : RendererBase instance
2224+
renderer : `.RendererBase` instance
22252225
renderer that will be used to draw the figures (i.e.
22262226
``fig.canvas.get_renderer()``)
22272227
2228-
bbox_extra_artists : list of `Artist` or ``None``
2228+
bbox_extra_artists : list of `.Artist` or ``None``
22292229
List of artists to include in the tight bounding box. If
22302230
``None`` (default), then all artist children of each axes are
22312231
included in the tight bounding box.
22322232
22332233
Returns
22342234
-------
2235-
`BboxBase` : containing the bounding box (in figure co-ordinates).
2235+
`.BboxBase` : containing the bounding box (in figure co-ordinates).
22362236
"""
22372237

22382238
bb = []

lib/matplotlib/legend.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,20 @@ def get_window_extent(self, *args, **kwargs):
11261126
return self.legendPatch.get_window_extent(*args, **kwargs)
11271127

11281128
def get_tightbbox(self, renderer):
1129-
'Return extent of the legend.'
1129+
"""
1130+
Like `.Legend.get_window_extent`, but uses the box for the legend.
1131+
1132+
Parameters
1133+
----------
1134+
renderer : `.RendererBase` instance
1135+
renderer that will be used to draw the figures (i.e.
1136+
``fig.canvas.get_renderer()``)
1137+
1138+
Returns
1139+
-------
1140+
`.BboxBase` : containing the bounding box (in figure-relative
1141+
co-ordinates).
1142+
"""
11301143
return self._legend_box.get_window_extent(renderer)
11311144

11321145
def get_frame_on(self):

0 commit comments

Comments
 (0)
0