@@ -576,18 +576,21 @@ def __setstate__(self, state):
576576
577577 def get_window_extent (self , * args , ** kwargs ):
578578 """
579- get the axes bounding box in display space; *args* and
580- *kwargs* are empty
581- """
582- bbox = self .bbox
583- x_pad = 0
584- if self .axison and self .xaxis .get_visible ():
585- x_pad = self .xaxis .get_tick_padding ()
586- y_pad = 0
587- if self .axison and self .yaxis .get_visible ():
588- y_pad = self .yaxis .get_tick_padding ()
589- return mtransforms .Bbox ([[bbox .x0 - x_pad , bbox .y0 - y_pad ],
590- [bbox .x1 + x_pad , bbox .y1 + y_pad ]])
579+ Return the axes bounding box in display space; *args* and *kwargs*
580+ are empty.
581+
582+ This bounding box does not include the spines, ticks, ticklables,
583+ or other labels. For a bounding box including these elements use
584+ `~matplotlib.axes.Axes.get_tightbbox`.
585+
586+ See Also
587+ --------
588+ matplotlib.axes.Axes.get_tightbbox
589+ matplotlib.axis.Axis.get_tightbbox
590+ matplotlib.spines.get_window_extent
591+
592+ """
593+ return self .bbox
591594
592595 def _init_axis (self ):
593596 "move this out of __init__ because non-separable axes don't use it"
@@ -4286,6 +4289,13 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
42864289 -------
42874290 bbox : `.BboxBase`
42884291 bounding box in figure pixel coordinates.
4292+
4293+ See Also
4294+ --------
4295+ matplotlib.axis.Axes.get_window_extent
4296+ matplotlib.axis.Axis.get_tightbbox
4297+ matplotlib.spines.get_window_extent
4298+
42894299 """
42904300
42914301 bb = []
@@ -4300,13 +4310,14 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
43004310 else :
43014311 self .apply_aspect ()
43024312
4303- bb_xaxis = self .xaxis .get_tightbbox (renderer )
4304- if bb_xaxis :
4305- bb .append (bb_xaxis )
4313+ if self .axison :
4314+ bb_xaxis = self .xaxis .get_tightbbox (renderer )
4315+ if bb_xaxis :
4316+ bb .append (bb_xaxis )
43064317
4307- bb_yaxis = self .yaxis .get_tightbbox (renderer )
4308- if bb_yaxis :
4309- bb .append (bb_yaxis )
4318+ bb_yaxis = self .yaxis .get_tightbbox (renderer )
4319+ if bb_yaxis :
4320+ bb .append (bb_yaxis )
43104321
43114322 self ._update_title_position (renderer )
43124323 bb .append (self .get_window_extent (renderer ))
0 commit comments