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

Skip to content

Commit 14fad1c

Browse files
committed
Turn minorticks on for Log Colorbar only on initialization or full reset
Fixes issue where colorbar lognorm minorticks are turned back on anytime ticks are updated
1 parent 17625f2 commit 14fad1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/tests/test_colorbar.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ def test_colorbar_minorticks_on_off():
325325
assert np.array_equal(cbar.ax.yaxis.get_minorticklocs(),
326326
default_minorticklocks)
327327

328+
# test issue #13339: minorticks for LogNorm should stay off
329+
cbar.minorticks_off()
330+
cbar.set_ticks([3, 5, 7, 9])
331+
assert np.array_equal(cbar.ax.yaxis.get_minorticklocs(),
332+
np.array([]))
333+
328334

329335
def test_colorbar_autoticks():
330336
# Test new autotick modes. Needs to be classic because

0 commit comments

Comments
 (0)