File tree 1 file changed +18
-0
lines changed 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,24 @@ def test_colorbar_minorticks_on_off():
307
307
np .testing .assert_almost_equal (cbar .ax .yaxis .get_minorticklocs (),
308
308
correct_minorticklocs )
309
309
310
+ # tests for github issue #13257 and PR #13265
311
+ data = np .random .uniform (low = 1 , high = 10 , size = (20 , 20 ))
312
+
313
+ fig , ax = plt .subplots ()
314
+ im = ax .pcolormesh (data , norm = LogNorm ())
315
+ cbar = fig .colorbar (im )
316
+ default_minorticklocks = cbar .ax .yaxis .get_minorticklocs ()
317
+
318
+ # test that minorticks turn off for LogNorm
319
+ cbar .minorticks_off ()
320
+ assert np .array_equal (cbar .ax .yaxis .get_minorticklocs (),
321
+ np .array ([]))
322
+
323
+ # test that minorticks turn back on for LogNorm
324
+ cbar .minorticks_on ()
325
+ assert np .array_equal (cbar .ax .yaxis .get_minorticklocs (),
326
+ default_minorticklocks )
327
+
310
328
311
329
def test_colorbar_autoticks ():
312
330
# Test new autotick modes. Needs to be classic because
You can’t perform that action at this time.
0 commit comments