@@ -31,17 +31,8 @@ def _tick_only(ax, bottom_on, left_on):
3131
3232class CbarAxesBase :
3333
34- def colorbar (self , mappable , * , locator = None , ** kwargs ):
35-
36- if locator is None :
37- if "ticks" not in kwargs :
38- kwargs ["ticks" ] = ticker .MaxNLocator (5 )
39- if locator is not None :
40- if "ticks" in kwargs :
41- raise ValueError ("Either *locator* or *ticks* need" +
42- " to be given, not both" )
43- else :
44- kwargs ["ticks" ] = locator
34+ @cbook ._rename_parameter ("3.2" , "locator" , "ticks" )
35+ def colorbar (self , mappable , * , ticks = None , ** kwargs ):
4536
4637 if self .orientation in ["top" , "bottom" ]:
4738 orientation = "horizontal"
@@ -55,10 +46,13 @@ def colorbar(self, mappable, *, locator=None, **kwargs):
5546 "%(removal)s. Set the 'mpl_toolkits.legacy_colorbar' rcParam "
5647 "to False to use Matplotlib's default colorbar implementation "
5748 "and suppress this deprecation warning." )
49+ if ticks is None :
50+ ticks = ticker .MaxNLocator (5 ) # For backcompat.
5851 from .colorbar import Colorbar
5952 else :
6053 from matplotlib .colorbar import Colorbar
61- cb = Colorbar (self , mappable , orientation = orientation , ** kwargs )
54+ cb = Colorbar (
55+ self , mappable , orientation = orientation , ticks = ticks , ** kwargs )
6256 self ._config_axes ()
6357
6458 def on_changed (m ):
0 commit comments