Skip to content

Commit 92f6a11

Browse files
Add testcase for toolmanager set axes navigate_mode
1 parent 882f485 commit 92f6a11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/matplotlib/tests/test_backend_bases.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,14 @@ def test_interactive_zoom():
157157

158158
tb.zoom()
159159
assert ax.get_navigate_mode() is None
160+
161+
162+
def test_toolbar_zoompan():
163+
plt.rcParams['toolbar'] = 'toolmanager'
164+
ax = plt.gca()
165+
assert ax.get_navigate_mode() is None
166+
tb = NavigationToolbar2(ax.figure.canvas)
167+
tb.zoom()
168+
assert ax.get_navigate_mode() == "ZOOM"
169+
tb.pan()
170+
assert ax.get_navigate_mode() == "PAN"

0 commit comments

Comments
 (0)