Parameters ---------- loc The tick location in data coords. size The tick size in points.
(
self, axes, loc, *,
size=None, # points
width=None,
color=None,
tickdir=None,
pad=None,
labelsize=None,
labelcolor=None,
labelfontfamily=None,
zorder=None,
gridOn=None, # defaults to axes.grid depending on axes.grid.which
tick1On=True,
tick2On=True,
label1On=True,
label2On=False,
major=True,
labelrotation=0,
labelrotation_mode=None,
grid_color=None,
grid_linestyle=None,
grid_linewidth=None,
grid_alpha=None,
**kwargs, # Other Line2D kwargs applied to gridlines.
)
| 67 | `.Line2D.set_markeredgecolor` and not `.Line2D.set_color`. |
| 68 | """ |
| 69 | def __init__( |
| 70 | self, axes, loc, *, |
| 71 | size=None, # points |
| 72 | width=None, |
| 73 | color=None, |
| 74 | tickdir=None, |
| 75 | pad=None, |
| 76 | labelsize=None, |
| 77 | labelcolor=None, |
| 78 | labelfontfamily=None, |
| 79 | zorder=None, |
| 80 | gridOn=None, # defaults to axes.grid depending on axes.grid.which |
| 81 | tick1On=True, |
| 82 | tick2On=True, |
| 83 | label1On=True, |
| 84 | label2On=False, |
| 85 | major=True, |
| 86 | labelrotation=0, |
| 87 | labelrotation_mode=None, |
| 88 | grid_color=None, |
| 89 | grid_linestyle=None, |
| 90 | grid_linewidth=None, |
| 91 | grid_alpha=None, |
| 92 | **kwargs, # Other Line2D kwargs applied to gridlines. |
| 93 | ): |
| 94 | """ |
| 95 | Parameters |
| 96 | ---------- |
| 97 | loc |
| 98 | The tick location in data coords. |
| 99 | size |
| 100 | The tick size in points. |
| 101 | """ |
| 102 | super().__init__() |
| 103 | |
| 104 | if gridOn is None: |
| 105 | which = mpl.rcParams['axes.grid.which'] |
| 106 | if major and which in ('both', 'major'): |
| 107 | gridOn = mpl.rcParams['axes.grid'] |
| 108 | elif not major and which in ('both', 'minor'): |
| 109 | gridOn = mpl.rcParams['axes.grid'] |
| 110 | else: |
| 111 | gridOn = False |
| 112 | |
| 113 | self.set_figure(axes.get_figure(root=False)) |
| 114 | self.axes = axes |
| 115 | |
| 116 | self._loc = loc |
| 117 | self._major = major |
| 118 | |
| 119 | name = self.__name__ |
| 120 | major_minor = "major" if major else "minor" |
| 121 | self._size = mpl._val_or_rc(size, f"{name}.{major_minor}.size") |
| 122 | self._width = mpl._val_or_rc(width, f"{name}.{major_minor}.width") |
| 123 | self._base_pad = mpl._val_or_rc(pad, f"{name}.{major_minor}.pad") |
| 124 | color = mpl._val_or_rc(color, f"{name}.color") |
| 125 | labelcolor = mpl._val_or_rc(labelcolor, f"{name}.labelcolor") |
| 126 | if cbook._str_equal(labelcolor, 'inherit'): |
no test coverage detected