Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1636407

Browse filesBrowse files
authored
Merge pull request #14376 from anntzer/inlayout
Simplify removal of figure patch from bbox calculations.
2 parents 150faa1 + 26ffec1 commit 1636407
Copy full SHA for 1636407

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,10 @@ def __init__(self,
363363
self.transFigure = BboxTransformTo(self.bbox)
364364

365365
self.patch = Rectangle(
366-
xy=(0, 0), width=1, height=1,
366+
xy=(0, 0), width=1, height=1, visible=frameon,
367367
facecolor=facecolor, edgecolor=edgecolor, linewidth=linewidth,
368-
visible=frameon)
368+
# Don't let the figure patch influence bbox calculation.
369+
in_layout=False)
369370
self._set_artist_props(self.patch)
370371
self.patch.set_antialiased(False)
371372

@@ -2339,9 +2340,6 @@ def get_default_bbox_extra_artists(self):
23392340
for ax in self.axes:
23402341
if ax.get_visible():
23412342
bbox_artists.extend(ax.get_default_bbox_extra_artists())
2342-
# we don't want the figure's patch to influence the bbox calculation
2343-
if self.patch in bbox_artists:
2344-
bbox_artists.remove(self.patch)
23452343
return bbox_artists
23462344

23472345
def get_tightbbox(self, renderer, bbox_extra_artists=None):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.