from matplotlib.ticker import ScalarFormatter, FormatStrFormatter
ax.xaxis.set_major_formatter(FormatStrFormatter('%.0f'))
How to prevent numbers being changed to exponential form in Python matplotlib figure