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

Skip to content

Commit b74c0fd

Browse files
committed
FIX: add loglocator for minor colorbar
1 parent 52e5d81 commit b74c0fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/api/api_changes/2017-12-01-JMK.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ The ticks for colorbar now adjust for the size of the colorbar
33

44
Colorbar ticks now adjust for the size of the colorbar if the
55
colorbar is made from a mappable that is not a contour or
6-
doesn't have a BoundaryNorm, or boundaries are not specified.
6+
doesn't have a BoundaryNorm, or boundaries are not specified.
77
If boundaries, etc are specified, the colorbar maintains the
88
original behaviour.

lib/matplotlib/colorbar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ class _ColorbarAutoLocator(ticker.MaxNLocator):
232232

233233
def __init__(self, colorbar):
234234
"""
235-
_ColorbarAutoLocator(colorbar)
236-
237235
This ticker needs to know the *colorbar* so that it can access
238236
its *vmin* and *vmax*. Otherwise it is the same as
239237
`~.ticker.AutoLocator`.
@@ -515,7 +513,9 @@ def update_ticks(self):
515513
if type(self.norm) == colors.LogNorm:
516514
long_axis.set_minor_locator(_ColorbarLogLocator(self,
517515
base=10., subs='auto'))
518-
long_axis.set_minor_formatter(ticker.NullFormatter())
516+
long_axis.set_minor_formatter(
517+
ticker.LogFormatter()
518+
)
519519
else:
520520
_log.debug('Using fixed locator on colorbar')
521521
ticks, ticklabels, offset_string = self._ticker(locator, formatter)

0 commit comments

Comments
 (0)