diff --git a/lib/matplotlib/backend_bases.pyi b/lib/matplotlib/backend_bases.pyi index fe492f0dde66..787c2ea81d6f 100644 --- a/lib/matplotlib/backend_bases.pyi +++ b/lib/matplotlib/backend_bases.pyi @@ -484,7 +484,7 @@ class NavigationToolbar2: def release_zoom(self, event: Event) -> None: ... def push_current(self) -> None: ... subplot_tool: widgets.SubplotTool - def configure_subplots(self, *args: Any) -> widgets.SubplotTool: ... + def configure_subplots(self, *args: Any) -> object: ... def save_figure(self, *args) -> str | None | object: ... def update(self) -> None: ... def set_history_buttons(self) -> None: ... diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 8cdacca8c0a3..39ff36acd86d 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -153,7 +153,6 @@ ResizeEventType, LogLevel ) - from matplotlib.widgets import SubplotTool from matplotlib._api import _Unset @@ -2152,13 +2151,16 @@ def twiny(ax: matplotlib.axes.Axes | None = None) -> _AxesBase: return ax1 -def subplot_tool(targetfig: Figure | None = None) -> SubplotTool | None: +def subplot_tool(targetfig: Figure | None = None) -> object | None: """ Launch a subplot tool window for a figure. Returns ------- - `matplotlib.widgets.SubplotTool` + object or None + The subplot tool window: a `~matplotlib.widgets.SubplotTool` for the + widgets backend, an implementation-specific value for other backends + (e.g. a Qt dialog), or `None` for backends using the toolmanager. """ if targetfig is None: targetfig = gcf()