MCPcopy
hub / github.com/matplotlib/matplotlib / set_tick_params

Method set_tick_params

lib/matplotlib/axis.py:992–1035  ·  view source on GitHub ↗

Set appearance parameters for ticks, ticklabels, and gridlines. For documentation of keyword arguments, see :meth:`matplotlib.axes.Axes.tick_params`. See Also -------- .Axis.get_tick_params View the current style settings for ticks, tick

(self, which='major', reset=False, **kwargs)

Source from the content-addressed store, hash-verified

990 self.set_minor_locator(mticker.NullLocator())
991
992 def set_tick_params(self, which='major', reset=False, **kwargs):
993 """
994 Set appearance parameters for ticks, ticklabels, and gridlines.
995
996 For documentation of keyword arguments, see
997 :meth:`matplotlib.axes.Axes.tick_params`.
998
999 See Also
1000 --------
1001 .Axis.get_tick_params
1002 View the current style settings for ticks, ticklabels, and
1003 gridlines.
1004 """
1005 _api.check_in_list(['major', 'minor', 'both'], which=which)
1006 kwtrans = self._translate_tick_params(kwargs)
1007
1008 # the kwargs are stored in self._major/minor_tick_kw so that any
1009 # future new ticks will automatically get them
1010 if reset:
1011 if which in ['major', 'both']:
1012 self._reset_major_tick_kw()
1013 self._major_tick_kw.update(kwtrans)
1014 if which in ['minor', 'both']:
1015 self._reset_minor_tick_kw()
1016 self._minor_tick_kw.update(kwtrans)
1017 self.reset_ticks()
1018 else:
1019 if which in ['major', 'both']:
1020 self._major_tick_kw.update(kwtrans)
1021 for tick in self.majorTicks:
1022 tick._apply_params(**kwtrans)
1023 if which in ['minor', 'both']:
1024 self._minor_tick_kw.update(kwtrans)
1025 for tick in self.minorTicks:
1026 tick._apply_params(**kwtrans)
1027 # labelOn and labelcolor also apply to the offset text.
1028 if 'label1On' in kwtrans or 'label2On' in kwtrans:
1029 self.offsetText.set_visible(
1030 self._major_tick_kw.get('label1On', False)
1031 or self._major_tick_kw.get('label2On', False))
1032 if 'labelcolor' in kwtrans:
1033 self.offsetText.set_color(kwtrans['labelcolor'])
1034
1035 self.stale = True
1036
1037 def get_tick_params(self, which='major'):
1038 """

Callers 15

gridMethod · 0.95
tick_paramsMethod · 0.80
toggleMethod · 0.80
set_ticks_positionMethod · 0.80
tick_topMethod · 0.80
tick_bottomMethod · 0.80
set_ticks_positionMethod · 0.80
tick_rightMethod · 0.80
tick_leftMethod · 0.80
clearMethod · 0.80
tick_paramsMethod · 0.80
_label_outer_xaxisMethod · 0.80

Calls 9

_reset_major_tick_kwMethod · 0.95
_reset_minor_tick_kwMethod · 0.95
reset_ticksMethod · 0.95
updateMethod · 0.45
_apply_paramsMethod · 0.45
set_visibleMethod · 0.45
getMethod · 0.45
set_colorMethod · 0.45