There is a better, and simpler, solution than the one given by John Vinyard. Use NullLocator
:
import matplotlib.pyplot as plt
plt.plot(range(10))
plt.gca().xaxis.set_major_locator(plt.NullLocator())
plt.show()
plt.savefig('plot')
Hope that helps.