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

Skip to content

Commit 42c640e

Browse files
committed
axes_grid: add HostAxes.get_tightbbox
svn path=/trunk/matplotlib/; revision=7947
1 parent 43d86e6 commit 42c640e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/mpl_toolkits/axes_grid/parasite_axes.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from matplotlib.axes import subplot_class_factory
1111
from axislines import Axes
1212

13+
from matplotlib.transforms import Bbox
14+
1315
import numpy as np
1416

1517
import matplotlib.cbook as cbook
@@ -238,6 +240,16 @@ def legend(self, *args, **kwargs):
238240
return self.legend_
239241

240242

243+
def get_tightbbox(self, renderer):
244+
245+
bbs = [ax.get_tightbbox(renderer) for ax in self.parasites]
246+
bbs.append(super(HostAxes, self).get_tightbbox(renderer))
247+
248+
_bbox = Bbox.union([b for b in bbs if b.width!=0 or b.height!=0])
249+
250+
return _bbox
251+
252+
241253
def draw(self, renderer):
242254

243255
orig_artists = list(self.artists)

0 commit comments

Comments
 (0)