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

Skip to content

Commit 0a66897

Browse files
committed
FIX: pass colorbar.set_ticklabels down to long_axis
1 parent f8f6939 commit 0a66897

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/matplotlib/colorbar.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ def get_ticks(self, minor=False):
854854
return self._long_axis().get_majorticklocs()
855855

856856
@_api.delete_parameter("3.5", "update_ticks")
857-
def set_ticklabels(self, ticklabels, update_ticks=True):
857+
def set_ticklabels(self, ticklabels, *, minor=False, update_ticks=True,
858+
**kwargs):
858859
"""
859860
Set tick labels.
860861
@@ -868,12 +869,14 @@ def set_ticklabels(self, ticklabels, update_ticks=True):
868869
update_ticks : bool, default: True
869870
This keyword argument is ignored and will be be removed.
870871
Deprecated
872+
873+
minor : bool
874+
If True, set minor ticks instead of major ticks.
875+
876+
**kwargs
877+
Text properties.
871878
"""
872-
if isinstance(self.locator, ticker.FixedLocator):
873-
self.formatter = ticker.FixedFormatter(ticklabels)
874-
else:
875-
_api._warn_external("set_ticks() must have been called.")
876-
self.stale = True
879+
self._long_axis().set_ticklabels(ticklabels, minor=minor, **kwargs)
877880

878881
def minorticks_on(self):
879882
"""

0 commit comments

Comments
 (0)