Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efafb6c

Browse files
authored
Merge pull request #14466 from anntzer/secondary_tightbbox
Let SecondaryAxis inherit get_tightbbox from _AxesBase.
2 parents 3cc3ab8 + 119228b commit efafb6c

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

lib/matplotlib/axes/_secondary_axes.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -306,44 +306,6 @@ def _set_lims(self):
306306
lims = lims[::-1]
307307
set_lim(lims)
308308

309-
def get_tightbbox(self, renderer, call_axes_locator=True):
310-
"""
311-
Return the tight bounding box of the axes.
312-
The dimension of the Bbox in canvas coordinate.
313-
314-
If *call_axes_locator* is *False*, it does not call the
315-
_axes_locator attribute, which is necessary to get the correct
316-
bounding box. ``call_axes_locator==False`` can be used if the
317-
caller is only intereted in the relative size of the tightbbox
318-
compared to the axes bbox.
319-
"""
320-
321-
bb = []
322-
323-
if not self.get_visible():
324-
return None
325-
326-
self._set_lims()
327-
locator = self.get_axes_locator()
328-
if locator and call_axes_locator:
329-
pos = locator(self, renderer)
330-
self.apply_aspect(pos)
331-
else:
332-
self.apply_aspect()
333-
334-
if self._orientation == 'x':
335-
bb_axis = self.xaxis.get_tightbbox(renderer)
336-
else:
337-
bb_axis = self.yaxis.get_tightbbox(renderer)
338-
if bb_axis:
339-
bb.append(bb_axis)
340-
341-
bb.append(self.get_window_extent(renderer))
342-
_bbox = mtransforms.Bbox.union(
343-
[b for b in bb if b.width != 0 or b.height != 0])
344-
345-
return _bbox
346-
347309
def set_aspect(self, *args, **kwargs):
348310
"""
349311
Secondary axes cannot set the aspect ratio, so calling this just

0 commit comments

Comments
 (0)