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

Skip to content

Commit f257244

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

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/matplotlib/tests/test_axes.py

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

42784278

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

0 commit comments

Comments
 (0)