Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17db319

Browse filesBrowse files
committed
Remove randomness from test_colorbar_get_ticks_2.
The point of the test is to check that colorbar ticks have certain values when the scalarmappable's lower and upper lims are a bit more than 0 and a bit less than 1, respectively. Certainly sampling 30x30 random values will nearly always accomplish this, but we may as well just enforce the values.
1 parent fbbc84f commit 17db319
Copy full SHA for 17db319

File tree

Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-7
lines changed

‎lib/matplotlib/tests/test_colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colorbar.py
+5-7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.