matplotlib.pyplot.ticklabel_format#
- matplotlib.pyplot.ticklabel_format(*,axis='both',style=None,scilimits=None,useOffset=None,useLocale=None,useMathText=None)[source]#
Configure the
ScalarFormatterused by default for linear Axes.If a parameter is not set, the corresponding property of the formatteris left unchanged.
- Parameters:
- axis{'x', 'y', 'both'}, default: 'both'
The axis to configure. Only major ticks are affected.
- style{'sci', 'scientific', 'plain'}
Whether to use scientific notation.The formatter default is to use scientific notation.'sci' is equivalent to 'scientific'.
- scilimitspair of ints (m, n)
Scientific notation is used only for numbers outside the range10m to 10n (and only if the formatter isconfigured to use scientific notation at all). Use (0, 0) toinclude all numbers. Use (m, m) where m != 0 to fix the order ofmagnitude to 10m.The formatter default is
rcParams["axes.formatter.limits"](default:[-5,6]).- useOffsetbool or float
If True, the offset is calculated as needed.If False, no offset is used.If a numeric value, it sets the offset.The formatter default is
rcParams["axes.formatter.useoffset"](default:True).- useLocalebool
Whether to format the number using the current locale or using theC (English) locale. This affects e.g. the decimal separator. Theformatter default is
rcParams["axes.formatter.use_locale"](default:False).- useMathTextbool
Render the offset and scientific notation in mathtext.The formatter default is
rcParams["axes.formatter.use_mathtext"](default:False).
- Raises:
- AttributeError
If the current formatter is not a
ScalarFormatter.
Notes
Note
This is thepyplot wrapper for
axes.Axes.ticklabel_format.