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

Skip to content

FIX: maybe improve renderer dance #22732

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
Apr 4, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions lib/matplotlib/_constrained_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy as np

from matplotlib import _api, artist as martist
from matplotlib.backend_bases import _get_renderer
from matplotlib._tight_layout import get_renderer
import matplotlib.transforms as mtransforms
import matplotlib._layoutgrid as mlayoutgrid

Expand Down Expand Up @@ -92,7 +92,7 @@ def do_constrained_layout(fig, h_pad, w_pad,
layoutgrid : private debugging structure
"""

renderer = _get_renderer(fig)
renderer = get_renderer(fig)
# make layoutgrid tree...
layoutgrids = make_layoutgrids(fig, None)
if not layoutgrids['hasgrids']:
Expand Down
5 changes: 3 additions & 2 deletions lib/matplotlib/layout_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
from matplotlib._constrained_layout import do_constrained_layout
from matplotlib._tight_layout import (get_subplotspec_list,
get_tight_layout_figure)
from matplotlib.backend_bases import _get_renderer
# from matplotlib.backend_bases import _get_renderer
from matplotlib._tight_layout import get_renderer


class LayoutEngine:
Expand Down Expand Up @@ -153,7 +154,7 @@ def execute(self, fig):
_api.warn_external("This figure includes Axes that are not "
"compatible with tight_layout, so results "
"might be incorrect.")
renderer = _get_renderer(fig)
renderer = get_renderer(fig)
with getattr(renderer, "_draw_disabled", nullcontext)():
kwargs = get_tight_layout_figure(
fig, fig.axes, subplotspec_list, renderer,
Expand Down