Skip to content

Commit 2f49642

Browse files
committed
Restore get_renderer function in deprecated tight_layout
1 parent 54360f3 commit 2f49642

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/tight_layout.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
from matplotlib._tight_layout import * # noqa: F401, F403
22
from matplotlib import _api
33
_api.warn_deprecated("3.6", name=__name__, obj_type="module")
4+
5+
6+
# To be removed with the module
7+
def get_renderer(fig):
8+
if fig._cachedRenderer:
9+
return fig._cachedRenderer
10+
else:
11+
canvas = fig.canvas
12+
if canvas and hasattr(canvas, "get_renderer"):
13+
return canvas.get_renderer()
14+
else:
15+
from . import backend_bases
16+
return backend_bases._get_renderer(fig)

0 commit comments

Comments
 (0)