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

Skip to content

Commit 42d2c6a

Browse files
committed
ENH have ax.get_tightbbox have a bbox around all artists
1 parent fd918ca commit 42d2c6a

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,35 +2184,7 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
21842184
dryrun=True,
21852185
**kwargs)
21862186
renderer = self.figure._cachedRenderer
2187-
bbox_inches = self.figure.get_tightbbox(renderer)
2188-
21892187
bbox_artists = kwargs.pop("bbox_extra_artists", None)
2190-
if bbox_artists is None:
2191-
bbox_artists = \
2192-
self.figure.get_default_bbox_extra_artists()
2193-
2194-
bbox_filtered = []
2195-
for a in bbox_artists:
2196-
bbox = a.get_window_extent(renderer)
2197-
if a.get_clip_on():
2198-
clip_box = a.get_clip_box()
2199-
if clip_box is not None:
2200-
bbox = Bbox.intersection(bbox, clip_box)
2201-
clip_path = a.get_clip_path()
2202-
if clip_path is not None and bbox is not None:
2203-
clip_path = \
2204-
clip_path.get_fully_transformed_path()
2205-
bbox = Bbox.intersection(
2206-
bbox, clip_path.get_extents())
2207-
if bbox is not None and (
2208-
bbox.width != 0 or bbox.height != 0):
2209-
bbox_filtered.append(bbox)
2210-
2211-
if bbox_filtered:
2212-
_bbox = Bbox.union(bbox_filtered)
2213-
trans = Affine2D().scale(1.0 / self.figure.dpi)
2214-
bbox_extra = TransformedBbox(_bbox, trans)
2215-
bbox_inches = Bbox.union([bbox_inches, bbox_extra])
22162188

22172189
pad = kwargs.pop("pad_inches", None)
22182190
if pad is None:

0 commit comments

Comments
 (0)