8000 Simplify removal of figure patch from bbox calculations. by anntzer · Pull Request #14376 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Simplify removal of figure patch from bbox calculations. #14376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ def __init__(self,
self.transFigure = BboxTransformTo(self.bbox)

self.patch = Rectangle(
xy=(0, 0), width=1, height=1,
xy=(0, 0), width=1, height=1, visible=frameon,
facecolor=facecolor, edgecolor=edgecolor, linewidth=linewidth,
71FD visible=frameon)
# Don't let the figure patch influence bbox calculation.
in_layout=False)
self._set_artist_props(self.patch)
self.patch.set_antialiased(False)

Expand Down Expand Up @@ -2339,9 +2340,6 @@ def get_default_bbox_extra_artists(self):
for ax in self.axes:
if ax.get_visible():
bbox_artists.extend(ax.get_default_bbox_extra_artists())
# we don't want the figure's patch to influence the bbox calculation
if self.patch in bbox_artists:
bbox_artists.remove(self.patch)
return bbox_artists

def get_tightbbox(self, renderer, bbox_extra_artists=None):
Expand Down
0