Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd99fb8

Browse files
committed
Add test for pre-locked zoom/pan
1 parent c063363 commit fd99fb8

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
@@ -175,6 +175,17 @@ def test_interactive_zoom():
175175
assert not ax.get_autoscalex_on() and not ax.get_autoscaley_on()
176176

177177

178+
def test_widgetlock_zoompan():
179+
fig, ax = plt.subplots()
180+
ax.plot([0, 1], [0, 1])
181+
fig.canvas.widgetlock(ax)
182+
tb = NavigationToolbar2(fig.canvas)
183+
tb.zoom()
184+
assert ax.get_navigate_mode() is None
185+
tb.pan()
186+
assert ax.get_navigate_mode() is None
187+
188+
178189
@pytest.mark.parametrize("plot_func", ["imshow", "contourf"])
179190
@pytest.mark.parametrize("orientation", ["vertical", "horizontal"])
180191
@pytest.mark.parametrize("tool,button,expected",

0 commit comments

Comments
 (0)