I’m using Matplotlib in Python to plot simple x-y datasets. This produces nice-looking graphs, although when I “zoom in” too close on various sections of the plotted graph using the Figure View (which appears when you execute plt.show() ), the x-axis values change from standard number form (1050, 1060, 1070 etc.) to scientific form with exponential notation (e.g. 1, 1.5, 2.0 with the x-axis label given as +1.057e3).
I’d prefer my figures to retain the simple numbering of the axis, rather than using exponential form. Is there a way I can force Matplotlib to do this?
The formatting of tick labels is controlled by a
Formatterobject, which assuming you haven’t done anything fancy will be aScalerFormatterby default. This formatter will use a constant shift if the fractional change of the values visible is very small. To avoid this, simply turn it off:If you want to avoid scientific notation in general,
Can control this with globally via the
axes.formatter.useoffsetrcparam.