8000 Merge pull request #16072 from anntzer/catdoc · matplotlib/matplotlib@b575820 · GitHub
[go: up one dir, main page]

Skip to content

Commit b575820

Browse files
authored
Merge pull request #16072 from anntzer/catdoc
Cleanup category.py docstrings.
2 parents 44ccb0e + 5694f4e commit b575820

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/matplotlib/category.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,17 @@ def __init__(self, units_mapping):
116116
"""
117117
Parameters
118118
-----------
119-
units_mapping : Dict[str, int]
119+
units_mapping : dict
120+
Mapping of category names (str) to indices (int).
120121
"""
121122
self._units = units_mapping
122123

123124
def __call__(self):
125+
# docstring inherited
124126
return list(self._units.values())
125127

126128
def tick_values(self, vmin, vmax):
129+
# docstring inherited
127130
return self()
128131

129132

@@ -133,19 +136,17 @@ def __init__(self, units_mapping):
133136
"""
134137
Parameters
135138
----------
136-
units_mapping : Dict[Str, int]
139+
units_mapping : dict
140+
Mapping of category names (str) to indices (int).
137141
"""
138142
self._units = units_mapping
139143

140144
def __call__(self, x, pos=None):
141-
"""
142-
Return the category label string for tick val *x*.
143-
144-
The position *pos* is ignored.
145-
"""
145+
# docstring inherited
146146
return self.format_ticks([x])[0]
147147

148148
def format_ticks(self, values):
149+
# docstring inherited
149150
r_mapping = {v: self._text(k) for k, v in self._units.items()}
150151
return [r_mapping.get(round(val), '') for val in values]
151152

0 commit comments

Comments
 (0)
0