Tick at every integer mapping of the string data.
| 117 | |
| 118 | |
| 119 | class StrCategoryLocator(ticker.Locator): |
| 120 | """Tick at every integer mapping of the string data.""" |
| 121 | def __init__(self, units_mapping): |
| 122 | """ |
| 123 | Parameters |
| 124 | ---------- |
| 125 | units_mapping : dict |
| 126 | Mapping of category names (str) to indices (int). |
| 127 | """ |
| 128 | self._units = units_mapping |
| 129 | |
| 130 | def __call__(self): |
| 131 | # docstring inherited |
| 132 | return list(self._units.values()) |
| 133 | |
| 134 | def tick_values(self, vmin, vmax): |
| 135 | # docstring inherited |
| 136 | return self() |
| 137 | |
| 138 | |
| 139 | class StrCategoryFormatter(ticker.Formatter): |
no outgoing calls
no test coverage detected
searching dependent graphs…