title: How can i set the location of minor ticks in matplotlib
body: <p>I want to draw a grid on the x-axis in a matplotlib plot at the positions of the minor ticks but not at the positions of the major ticks. My mayor ticks are at the positions 0, 1, 2, 3, 4, 5 and have to remain there. I want the grid at 0.5, 1.5, 2.5, 3.5, 4.5.</p>
  
  <pre><code>....
  from matplotlib.ticker import MultipleLocator
  ....
  minorLocator   = MultipleLocator(0.5)
  ax.xaxis.set_minor_locator(minorLocator)
  plt.grid(which='minor')
  </code></pre>
  
  <p>The code above does not work since it gives the locations at 0.5, 1.0, 1.5, ... How can I set the positions of the minor ticks manually?</p>