Skip to content
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

Backport PR #24301 on branch v3.6.x (Restore get_renderer function in deprecated tight_layout) #24341

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/matplotlib/tight_layout.py
@@ -1,3 +1,13 @@
from matplotlib._tight_layout import * # noqa: F401, F403
from matplotlib import _api
_api.warn_deprecated("3.6", name=__name__, obj_type="module")


@_api.deprecated("3.6", alternative="figure.canvas.get_renderer()")
def get_renderer(fig):
canvas = fig.canvas
if canvas and hasattr(canvas, "get_renderer"):
return canvas.get_renderer()
else:
from . import backend_bases
return backend_bases._get_renderer(fig)