diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index cc94e530133b..c2070d890ef6 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -162,6 +162,8 @@ from matplotlib.rcsetup import cycler # noqa: F401 from matplotlib.rcsetup import validate_backend +_mplbackend = os.environ.get('MPLBACKEND') + _log = logging.getLogger(__name__) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 2376c6243929..b4f703af7c36 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -78,6 +78,7 @@ from matplotlib.colors import _color_sequences, Colormap import numpy as np +import matplotlib.backends if TYPE_CHECKING: from collections.abc import Callable, Hashable, Iterable, Sequence @@ -617,7 +618,7 @@ def isinteractive() -> bool: show : Show all figures (and maybe block). pause : Show all figures, and block for a time. """ - return matplotlib.is_interactive() + return rcParams['interactive'] # Note: The return type of ioff being AbstractContextManager