title: How to set x-axis labels on a figure plotted using matplotlib's pyplot?
body: <p>I'm trying to plot sales and expenses values (on y-axis) over years (on x-axis) as given below. I'm expecting that the following code will set 2004, 2005, 2006 and 2007 as x-axis values. But, it is not showing as expected. See the image attached below. Let me know how to set the years values correctly on x-axis.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  years = [2004, 2005, 2006, 2007]
  sales = [1000, 1170, 660, 1030]
  expenses = [400, 460, 1120, 540]
  plt.plot(years, sales)
  plt.plot(years, expenses)
  plt.show()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/5Askg.png" alt="enter image description here"></p>