I have two subplots that share the same x-axis. I removed the xticklabels of the upper subplot, but the offset "1e7" remains visible. How can I hide it?
Here is the code I used :
import matplotlib.pyplot as plt
import numpy as np
plt.figure()
s1 = plt.subplot(2,1,1)
s1.plot(np.arange(0,1e8,1e7),np.arange(10))
s1.tick_params(axis="x", labelbottom=False)
s2 = plt.subplot(2,1,2, sharex=s1)
s2.plot(np.arange(0,1e8,1e7),np.arange(10))
I also tried s1.get_xaxis().get_major_formatter().set_useOffset(False)
, but it did nothing and I also tried s1.get_xaxis().get_major_formatter().set_powerlimits((-9,9))
but it impacted also the lower suplot.