Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore get_renderer function in deprecated tight_layout
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
from matplotlib._tight_layout import * # noqa: F401, F403 | ||
from matplotlib import _api | ||
_api.warn_deprecated("3.6", name=__name__, obj_type="module") | ||
|
||
|
||
# To be removed with the module | ||
def get_renderer(fig): | ||
if fig._cachedRenderer: | ||
return fig._cachedRenderer | ||
else: | ||
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) |