title: Not write out all dates on an axis, Matplotlib
body: <p>Take a look at this example:</p>
  
  <pre><code>import datetime as dt
  from matplotlib import pyplot as plt 
  import matplotlib.dates as mdates
  x = []
  d = dt.datetime(2013, 7, 4)
  for i in range(30):
          d = d+dt.timedelta(days=1)
          x.append(d)
  
  y = range(len(x))
  plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%d-%m-%Y'))
  plt.gca().xaxis.set_major_locator(mdates.DayLocator())
  plt.gcf().autofmt_xdate()
  plt.bar(x,y)
  plt.show()
  </code></pre>
  
  <p>The code writes out dates on the x-axis in the plot, see the picture below. The problem is that the dates get clogged up, as seen in the picture. How to make matplotlib to only write out every fifth or every tenth coordinate?</p>
  
  <p><img src="https://i.stack.imgur.com/HxaSu.png" alt="enter image description here"></p>