title: Center x-axis labels in line plot
body: <p>I am building a line plot with two lines, one for high temperatures and the other for low temperatures. The x-axis is based on days over one complete year in datetime format (2014-01-01, etc.). However, I changed the labels–not the data–for months (Jan, Feb, Mar, etc). The problem is that the first label 'Jan' is in the origin. What I want is to <strong>move all labels to the right to center them between ticks</strong>.</p>
  
  <pre><code>fig, ax = plt.subplots()
  
  plt.plot(x, y1)
  plt.plot(x, y2)
  
  # Change x-axis from %y-%m-%d format to %m:
  monthsFmt = mdates.DateFormatter('%m')
  plt.gca().xaxis.set_major_formatter(monthsFmt)
  
  # Replace numeric x-axis labels (1,2,3, ..., 12) for abbreviations of months ('Jan', 'Feb', 'Mar', etc.):
  labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  ax.set_xticklabels(labels)
  
  # CODE GOES HERE TO CENTER X-AXIS LABELS...
  
  # Render plot:
  plt.show()
  </code></pre>
  
  <p>This is the <strong>result that I am looking for</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/1mYGG.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/1mYGG.jpg" alt="enter image description here"></a></p>