@@ -54,29 +54,29 @@ class Tick(martist.Artist):
5454 The right/top tick label.
5555
5656 """
57- def __init__ (self , axes , loc , * ,
58- size = None , # points
59- width = None ,
60- color = None ,
61- tickdir = None ,
62- pad = None ,
63- labelsize = None ,
64- labelcolor = None ,
65- zorder = None ,
66- gridOn = None , # defaults to axes.grid depending on
67- # axes.grid.which
68- tick1On = True ,
69- tick2On = True ,
70- label1On = True ,
71- label2On = False ,
72- major = True ,
73- labelrotation = 0 ,
74- grid_color = None ,
75- grid_linestyle = None ,
76- grid_linewidth = None ,
77- grid_alpha = None ,
78- ** kw # Other Line2D kwargs applied to gridlines.
79- ):
57+ def __init__ (
58+ self , axes , loc , * ,
59+ size = None , # points
60+ width = None ,
61+ color = None ,
62+ tickdir = None ,
63+ pad = None ,
64+ labelsize = None ,
65+ labelcolor = None ,
66+ zorder = None ,
67+ gridOn = None , # defaults to axes.grid depending on axes.grid.which
68+ tick1On = True ,
69+ tick2On = True ,
70+ label1On = True ,
71+ label2On = False ,
72+ major = True ,
73+ labelrotation = 0 ,
74+ grid_color = None ,
75+ grid_linestyle = None ,
76+ grid_linewidth = None ,
77+ grid_alpha = None ,
78+ ** kwargs , # Other Line2D kwargs applied to gridlines.
79+ ):
8080 """
8181 bbox is the Bound2D bounding box in display coords of the Axes
8282 loc is the tick location in data coords
@@ -145,7 +145,7 @@ def __init__(self, axes, loc, *,
145145 grid_linewidth = mpl .rcParams ["grid.linewidth" ]
146146 if grid_alpha is None :
147147 grid_alpha = mpl .rcParams ["grid.alpha" ]
148- grid_kw = {k [5 :]: v for k , v in kw .items ()}
148+ grid_kw = {k [5 :]: v for k , v in kwargs .items ()}
149149
150150 self .tick1line = mlines .Line2D (
151151 [], [],
@@ -346,23 +346,23 @@ def get_view_interval(self):
346346 """
347347 raise NotImplementedError ('Derived must override' )
348348
349- def _apply_params (self , ** kw ):
349+ def _apply_params (self , ** kwargs ):
350350 for name , target in [("gridOn" , self .gridline ),
351351 ("tick1On" , self .tick1line ),
352352 ("tick2On" , self .tick2line ),
353353 ("label1On" , self .label1 ),
354354 ("label2On" , self .label2 )]:
355- if name in kw :
356- target .set_visible (kw .pop (name ))
357- if any (k in kw for k in ['size' , 'width' , 'pad' , 'tickdir' ]):
358- self ._size = kw .pop ('size' , self ._size )
355+ if name in kwargs :
356+ target .set_visible (kwargs .pop (name ))
357+ if any (k in kwargs for k in ['size' , 'width' , 'pad' , 'tickdir' ]):
358+ self ._size = kwargs .pop ('size' , self ._size )
359359 # Width could be handled outside this block, but it is
360360 # convenient to leave it here.
361- self ._width = kw .pop ('width' , self ._width )
362- self ._base_pad = kw .pop ('pad' , self ._base_pad )
361+ self ._width = kwargs .pop ('width' , self ._width )
362+ self ._base_pad = kwargs .pop ('pad' , self ._base_pad )
363363 # _apply_tickdir uses _size and _base_pad to make _pad, and also
364364 # sets the ticklines markers.
365- self ._apply_tickdir (kw .pop ('tickdir' , self ._tickdir ))
365+ self ._apply_tickdir (kwargs .pop ('tickdir' , self ._tickdir ))
366366 for line in (self .tick1line , self .tick2line ):
367367 line .set_markersize (self ._size )
368368 line .set_markeredgewidth (self ._width )
@@ -371,25 +371,25 @@ def _apply_params(self, **kw):
371371 self .label1 .set_transform (trans )
372372 trans = self ._get_text2_transform ()[0 ]
373373 self .label2 .set_transform (trans )
374- tick_kw = {k : v for k , v in kw .items () if k in ['color' , 'zorder' ]}
375- if 'color' in kw :
376- tick_kw ['markeredgecolor' ] = kw ['color' ]
374+ tick_kw = {k : v for k , v in kwargs .items () if k in ['color' , 'zorder' ]}
375+ if 'color' in kwargs :
376+ tick_kw ['markeredgecolor' ] = kwargs ['color' ]
377377 self .tick1line .set (** tick_kw )
378378 self .tick2line .set (** tick_kw )
379379 for k , v in tick_kw .items ():
380380 setattr (self , '_' + k , v )
381381
382- if 'labelrotation' in kw :
383- self ._set_labelrotation (kw .pop ('labelrotation' ))
382+ if 'labelrotation' in kwargs :
383+ self ._set_labelrotation (kwargs .pop ('labelrotation' ))
384384 self .label1 .set (rotation = self ._labelrotation [1 ])
385385 self .label2 .set (rotation = self ._labelrotation [1 ])
386386
387- label_kw = {k [5 :]: v for k , v in kw .items ()
387+ label_kw = {k [5 :]: v for k , v in kwargs .items ()
388388 if k in ['labelsize' , 'labelcolor' ]}
389389 self .label1 .set (** label_kw )
390390 self .label2 .set (** label_kw )
391391
392- grid_kw = {k [5 :]: v for k , v in kw .items ()
392+ grid_kw = {k [5 :]: v for k , v in kwargs .items ()
393393 if k in _gridline_param_names }
394394 self .gridline .set (** grid_kw )
395395
@@ -847,15 +847,15 @@ def reset_ticks(self):
847847 except AttributeError :
848848 pass
849849
850- def set_tick_params (self , which = 'major' , reset = False , ** kw ):
850+ def set_tick_params (self , which = 'major' , reset = False , ** kwargs ):
851851 """
852852 Set appearance parameters for ticks, ticklabels, and gridlines.
853853
854854 For documentation of keyword arguments, see
855855 :meth:`matplotlib.axes.Axes.tick_params`.
856856 """
857857 _api .check_in_list (['major' , 'minor' , 'both' ], which = which )
858- kwtrans = self ._translate_tick_kw (kw )
858+ kwtrans = self ._translate_tick_kw (kwargs )
859859
860860 # the kwargs are stored in self._major/minor_tick_kw so that any
861861 # future new ticks will automatically get them
0 commit comments