| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -206,13 +206,18 @@ class Formatter(TickHelper): | |||
| 206 | 206 | ||
| 207 | 207 | def __call__(self, x, pos=None): | |
| 208 | 208 | """ | |
| 209 | - Return the format for tick value *x* at position pos. | ||
| 209 | + Return the format for tick value *x* at index *pos*. | ||
| 210 | 210 | ``pos=None`` indicates an unspecified location. | |
| 211 | 211 | """ | |
| 212 | 212 | raise NotImplementedError('Derived must override') | |
| 213 | 213 | ||
| 214 | 214 | def format_ticks(self, values): | |
| 215 | - """Return the tick labels for all the ticks at once.""" | ||
| 215 | + """ | ||
| 216 | + Return the tick labels strings for all *values*. | ||
| 217 | + | ||
| 218 | + This method is the public API to generate a meaningful format for a set | ||
| 219 | + of values, e.g. by ensuring an appropriate precision. | ||
| 220 | + """ | ||
| 216 | 221 | self.set_locs(values) | |
| 217 | 222 | return [self(value, i) for i, value in enumerate(values)] | |
| 218 | 223 | ||
@@ -225,9 +230,13 @@ def format_data(self, value): | |||
| 225 | 230 | ||
| 226 | 231 | def format_data_short(self, value): | |
| 227 | 232 | """ | |
| 228 | - Return a short string version of the tick value. | ||
| 233 | + Return the mouseover-text representation of a value. | ||
| 234 | + | ||
| 235 | + This defaults to the representation returned by `.Formatter.format_data`, | ||
| 236 | + but subclasses may override this. | ||
| 229 | 237 | ||
| 230 | - Defaults to the position-independent long value. | ||
| 238 | + Note: The mouseover text can be customized by setting the | ||
| 239 | + ``Axes.fmt_xdata`` and ``Axes.fmt_ydata`` attributes. | ||
| 231 | 240 | """ | |
| 232 | 241 | return self.format_data(value) | |
| 233 | 242 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments