Skip to content

Commit

Permalink
Merge pull request #24341 from meeseeksmachine/auto-backport-of-pr-24…
Browse files Browse the repository at this point in the history
…301-on-v3.6.x

Backport PR #24301 on branch v3.6.x (Restore get_renderer function in deprecated tight_layout)
  • Loading branch information
QuLogic committed Nov 2, 2022
2 parents 8e3f120 + 8334597 commit 4334ef8
Showing 1 changed file with 10 additions and 0 deletions.
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)

0 comments on commit 4334ef8

Please sign in to comment.