Fixing Matplotlib's Scientific Notation

I use matplotlib all the time, but one of the most common problems I run into is when my axes are plotted on a scale that uses scientific notation. This is especially annoying when you’re trying to make two plots stacked on top of each other which share an x-axis. Here’s a simple example of the issue: import matplotlib matplotlib.use("Qt5Agg") import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 10, 1000) y = np.sin(x) z = 1e12\*(1-np.exp(-x)) fig = plt.figure() fig.subplots_adjust(hspace=0.05) upperAxes = fig.add_subplot(211) upperAxes.plot(x, y, color='k', linestyle='-') upperAxes.set_xticklabels([]) upperAxes.set_ylabel("y") lowerAxes = fig.add_subplot(212) lowerAxes.plot(x,z, color='r', linestyle='-') upperAxes.set_xlabel("x") upperAxes.set_ylabel("y") plt.savefig("example.svg") This code produces the following: ...