matplotlib.axis.Axis.set_major_formatter#
- Axis.set_major_formatter(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 usedfor the position must be labeled'pos'.See theStrMethodFormatterdocumentation formore information.For a function, a
FuncFormatteris used.The function must take two inputs (a tick valuexand apositionpos), and return a string containing the correspondingtick label.See theFuncFormatterdocumentation formore information.- Parameters:
- formatter
Formatter,str, or function
- formatter
Examples usingmatplotlib.axis.Axis.set_major_formatter#
SkewT-logP diagram: using transforms and custom projections
SkewT-logP diagram: using transforms and custom projections
SI prefixed offsets and natural order of magnitudes
SI prefixed offsets and natural order of magnitudes
On this page