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

Skip to content

Commit 485dd68

Browse files
committed
DOC: Added API entry, fixed Legend.get_tightbbox string
1 parent ec263c1 commit 485dd68

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
@@ -4101,11 +4101,11 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
41014101
41024102
Parameters
41034103
----------
4104-
renderer : RendererBase instance
4104+
renderer : `.RendererBase` instance
41054105
renderer that will be used to draw the figures (i.e.
41064106
``fig.canvas.get_renderer()``)
41074107
4108-
bbox_extra_artists : list of `Artist` or ``None``
4108+
bbox_extra_artists : list of `.Artist` or ``None``
41094109
List of artists to include in the tight bounding box. If
41104110
``None`` (default), then all artist children of the axes are
41114111
included in the tight bounding box.
@@ -4119,7 +4119,8 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
41194119
41204120
Returns
41214121
-------
4122-
`BboxBase` : containing the bounding box (in relative co-ordinates).
4122+
bbox : `.BboxBase`
4123+
containing the bounding box (in figure pixel co-ordinates).
41234124
"""
41244125

41254126
bb = []

lib/matplotlib/figure.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,18 +2038,19 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
20382038
20392039
Parameters
20402040
----------
2041-
renderer : RendererBase instance
2041+
renderer : `.RendererBase` instance
20422042
renderer that will be used to draw the figures (i.e.
20432043
``fig.canvas.get_renderer()``)
20442044
2045-
bbox_extra_artists : list of `Artist` or ``None``
2045+
bbox_extra_artists : list of `.Artist` or ``None``
20462046
List of artists to include in the tight bounding box. If
20472047
``None`` (default), then all artist children of each axes are
20482048
included in the tight bounding box.
20492049
20502050
Returns
20512051
-------
2052-
`BboxBase` : containing the bounding box (in figure co-ordinates).
2052+
bbox : `.BboxBase`
2053+
containing the bounding box (in figure inches).
20532054
"""
20542055

20552056
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.legendPatch.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