@@ -826,40 +826,35 @@ def set_tick_params(self, which='major', reset=False, **kw):
826
826
For documentation of keyword arguments, see
827
827
:meth:`matplotlib.axes.Axes.tick_params`.
828
828
"""
829
- blacklist = ['tick1On' , 'tick2On' , 'label1On' , 'label2On' , 'gridOn' ]
830
829
dicts = []
831
- blacklist_dicts = []
832
830
if which == 'major' or which == 'both' :
833
831
dicts .append (self ._major_tick_kw )
834
832
if which == 'minor' or which == 'both' :
835
833
dicts .append (self ._minor_tick_kw )
836
834
kwtrans = self ._translate_tick_kw (kw )
837
835
836
+ # this stashes the parameter changes so any new ticks will
837
+ # automatically get them
838
838
for d in dicts :
839
839
if reset :
840
840
d .clear ()
841
- blacklist_dicts .append (
842
- {
843
- k : d .pop (k ) for k in blacklist
844
- if k in d .keys () and k not in kwtrans .keys ()
845
- }
846
- )
847
841
d .update (kwtrans )
848
842
849
843
if reset :
850
844
self .reset_ticks ()
851
845
else :
846
+ # apply the new kwargs to the existing ticks
852
847
if which == 'major' or which == 'both' :
853
848
for tick in self .majorTicks :
854
- tick ._apply_params (** self . _major_tick_kw )
849
+ tick ._apply_params (** kwtrans )
855
850
if which == 'minor' or which == 'both' :
856
851
for tick in self .minorTicks :
857
- tick ._apply_params (** self ._minor_tick_kw )
852
+ tick ._apply_params (** kwtrans )
853
+ # special-case label color to also apply to the offset
854
+ # text
858
855
if 'labelcolor' in kwtrans :
859
856
self .offsetText .set_color (kwtrans ['labelcolor' ])
860
857
861
- for d , bd in zip (dicts , blacklist_dicts ):
862
- d .update (bd )
863
858
self .stale = True
864
859
865
860
@staticmethod
0 commit comments