Skip to content

Commit 6476ff3

Browse files
committed
Make NavigationToolbar.configure_subplots return value consistent
When the subplot tool already exists, then it is shown, but never returned. This seems to be an accident.
1 parent 6083ecd commit 6476ff3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3244,7 +3244,7 @@ def _update_view(self):
32443244
def configure_subplots(self, *args):
32453245
if hasattr(self, "subplot_tool"):
32463246
self.subplot_tool.figure.canvas.manager.show()
3247-
return
3247+
return self.subplot_tool
32483248
# This import needs to happen here due to circular imports.
32493249
from matplotlib.figure import Figure
32503250
with mpl.rc_context({"toolbar": "none"}): # No navbar for the toolfig.

lib/matplotlib/backend_bases.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class NavigationToolbar2:
475475
def release_zoom(self, event: Event) -> None: ...
476476
def push_current(self) -> None: ...
477477
subplot_tool: widgets.SubplotTool
478-
def configure_subplots(self, *args): ...
478+
def configure_subplots(self, *args: Any) -> widgets.SubplotTool: ...
479479
def save_figure(self, *args) -> str | None | object: ...
480480
def update(self) -> None: ...
481481
def set_history_buttons(self) -> None: ...

0 commit comments

Comments
 (0)