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

Skip to content

Commit c66ea79

Browse files
committed
TST: test that number of ticks adjust with aspect
1 parent f108196 commit c66ea79

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4275,6 +4275,19 @@ def _helper_y(ax):
42754275
assert assert_array_equal(ax_lst[0][1].get_xlim(), orig_xlim)
42764276

42774277

4278+
@cleanup
4279+
def test_adjust_numtick_aspect():
4280+
fig, ax = plt.subplots()
4281+
ax.yaxis.get_major_locator().set_params(nbins='auto')
4282+
ax.set_xlim(0, 1000)
4283+
ax.set_aspect('equal')
4284+
fig.canvas.draw()
4285+
assert len(ax.yaxis.get_major_locator()()) == 2
4286+
ax.set_ylim(0, 1000)
4287+
fig.canvas.draw()
4288+
assert len(ax.yaxis.get_major_locator()()) > 2
4289+
4290+
42784291
@image_comparison(baseline_images=["auto_numticks"], style='default',
42794292
extensions=['png'])
42804293
def test_auto_numticks():

0 commit comments

Comments
 (0)