matplotlib.axis.Axis.set_major_formatter
-
Axis.set_major_formatter(self, formatter)[source] -
Set the formatter of the major ticker.
In addition to a
Formatterinstance, this also accepts astror function.For a
straStrMethodFormatteris used. The field used for the value must be labeled'x'and the field used for the position must be labeled'pos'. See theStrMethodFormatterdocumentation for more information.For a function, a
FuncFormatteris used. The function must take two inputs (a tick valuexand a positionpos), and return a string containing the corresponding tick label. See theFuncFormatterdocumentation for more information.Parameters: -
formatterFormatter, str, or function
-
Examples using matplotlib.axis.Axis.set_major_formatter
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.3.3/api/_as_gen/matplotlib.axis.Axis.set_major_formatter.html