title: Matplotlib: How to get same "base" and "offset" parameters for axis ticks and axis tick labels
body: <p>I want to plot a series of values against a date range in matplotlib. I changed the tick <code>base</code> parameter to 7, to get one tick at the beginning of every week (<code>plticker.IndexLocator, base = 7</code>). The problem is that the <code>set_xticklabels</code> function does not accept a <code>base</code> parameter. As a result, the second tick (representing day 8 on the beginning of week 2) is labelled with day 2 from my date range list, and not with day 8 as it should be (see picture).</p>
  
  <p>How to give <code>set_xticklabels</code>a <code>base</code> parameter?</p>
  
  <p><strong>Here is the code:</strong></p>
  
  <pre><code>my_data = pd.read_csv("%r_filename_%s_%s_%d_%d.csv" % (num1, num2, num3, num4, num5), dayfirst=True)
  my_data.plot(ax=ax1, color='r', lw=2.)
  loc = plticker.IndexLocator(base=7, offset = 0) # this locator puts ticks at regular intervals
  ax1.set_xticklabels(my_data.Date, rotation=45, rotation_mode='anchor', ha='right') # this defines the tick labels
  ax1.xaxis.set_major_locator(loc)
  </code></pre>
  
  <p><strong>Here is the plot:</strong></p>
  
  <p><a href="http://i.stack.imgur.com/FDhh7.jpg" rel="nofollow">Plot</a></p>