How to remove scientific notation on a matplotlib log-log plot
Those are minor ticks on the x-axis (i.e. they are not on integer powers of 10), not major ticks. matplotlib
automatically detemines if it should label the major or minor ticks - in this case because you don't have any major ticks displayed in the x range, the minor ticks are being labelled). So, you need to use the set_minor_formatter
method:
ax.xaxis.set_minor_formatter(mticker.ScalarFormatter())
The reason it works on the y-axis is because those ticks are major ticks (i.e. on integer powers of 10), not minor ticks.
The following can be used as a workaround (original answer):
from matplotlib.ticker import StrMethodFormatter, NullFormatter
ax.yaxis.set_major_formatter(StrMethodFormatter('{x:.0f}'))
ax.yaxis.set_minor_formatter(NullFormatter())