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

Skip to content

Commit a0569fe

Browse files
authored
Merge pull request #17361 from anntzer/unrandcbt
Remove randomness from test_colorbar_get_ticks_2.
2 parents b5fbbb5 + 17db319 commit a0569fe

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/matplotlib/tests/test_colorbar.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,11 @@ def test_colorbar_scale_reset():
534534

535535

536536
def test_colorbar_get_ticks_2():
537-
with rc_context({'_internal.classic_mode': False}):
538-
539-
fig, ax = plt.subplots()
540-
np.random.seed(19680801)
541-
pc = ax.pcolormesh(np.random.rand(30, 30))
542-
cb = fig.colorbar(pc)
543-
np.testing.assert_allclose(cb.get_ticks(), [0.2, 0.4, 0.6, 0.8])
537+
plt.rcParams['_internal.classic_mode'] = False
538+
fig, ax = plt.subplots()
539+
pc = ax.pcolormesh([[.05, .95]])
540+
cb = fig.colorbar(pc)
541+
np.testing.assert_allclose(cb.get_ticks(), [0.2, 0.4, 0.6, 0.8])
544542

545543

546544
def test_colorbar_inverted_ticks():

0 commit comments

Comments
 (0)