@@ -889,9 +889,10 @@ def set_tick_params(self, which='major', reset=False, **kw):
889889 :meth:`matplotlib.axes.Axes.tick_params`.
890890 """
891891 dicts = []
892- if which == 'major' or which == 'both' :
892+ cbook ._check_in_list (['major' , 'minor' , 'both' ], which = which )
893+ if which in ['major' , 'both' ]:
893894 dicts .append (self ._major_tick_kw )
894- if which == 'minor' or which == 'both' :
895+ if which in [ 'minor' , 'both' ] :
895896 dicts .append (self ._minor_tick_kw )
896897 kwtrans = self ._translate_tick_kw (kw )
897898
@@ -906,10 +907,10 @@ def set_tick_params(self, which='major', reset=False, **kw):
906907 self .reset_ticks ()
907908 else :
908909 # apply the new kwargs to the existing ticks
909- if which == 'major' or which == 'both' :
910+ if which in [ 'major' , 'both' ] :
910911 for tick in self .majorTicks :
911912 tick ._apply_params (** kwtrans )
912- if which == 'minor' or which == 'both' :
913+ if which in [ 'minor' , 'both' ] :
913914 for tick in self .minorTicks :
914915 tick ._apply_params (** kwtrans )
915916 # special-case label color to also apply to the offset
0 commit comments