title: Matplotlib tick label precision
body: <p>When defining tick labels I get an abnormally high level of precision.  For example:</p>
  
  <pre><code>import pylab as pl
  
  fig = pl.figure(figsize=(3.25, 2.5))
  ax0 = fig.add_subplot(111)
  
  ax0.set_ylim([0, 0.5])
  ax0.set_yticks(np.arange(0, 0.51, 0.1), minor=False)
  ax0.set_yticklabels(np.arange(0, 0.51, 0.1), fontsize=8)
  
  ax0.set_xlim([0, 0.5])
  ax0.set_xticks(np.arange(0, 0.51, 0.1), minor=False)
  ax0.set_xticklabels(np.arange(0, 0.51, 0.1), fontsize=8)
  
  fig.show()
  </code></pre>
  
  <p>The output figure is below with the bad tick labels on the 0.3 marker (both x and y axes).  I have tried using np.linspace, which yields the same problem.  </p>
  
  <p>I understand the issues with floating point precision, but I would expect the label to be rounded off a lot sooner.  How do I correct this to only show the first decimal?  </p>
  
  <p>Using matplotlib 2.2.2
  <a href="https://i.stack.imgur.com/KaD4M.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KaD4M.png" alt="Figure with bad labels."></a></p>