8000 TST: test that get_ticks works · matplotlib/matplotlib@15e4e79 · GitHub
[go: up one dir, main page]

Skip to content

Commit 15e4e79

Browse files
committed
TST: test that get_ticks works
1 parent 968ab3e commit 15e4e79

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_colorbar.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,13 @@ def test_colorbar_renorm():
436436
cbar.update_normal(im)
437437
assert np.isclose(cbar.vmin, z.min() * 1000)
438438
assert np.isclose(cbar.vmax, z.max() * 1000)
439+
440+
441+
def test_colorbar_get_ticks():
442+
with rc_context({'_internal.classic_mode': False}):
443+
444+
fig, ax = plt. subplots()
445+
np.random.seed(19680801)
446+
pc = ax.pcolormesh(np.random.rand(30, 30))
447+
cb = fig.colorbar(pc)
448+
np.testing.assert_allclose(cb.get_ticks(), [0.2, 0.4, 0.6, 0.8])

0 commit comments

Comments
 (0)
0