title: matplotlib.pyplot: set distance for axis units
body: <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  x = [0,5,9,10,15]
  y = [0,1,2,3,4]
  plt.plot(x,y)
  plt.xticks(np.arange(min(x), max(x)+1, 1))
  plt.show()
  </code></pre>
  
  <p>shows
  <a href="https://i.stack.imgur.com/2Nph2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Nph2.png" alt="enter image description here"></a></p>
  
  <p>But if I set unit to 0.5:
  <code>plt.xticks(np.arange(min(x), max(x)+1, 0.5))</code> shows
  <a href="https://i.stack.imgur.com/Ervvf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ervvf.png" alt="enter image description here"></a></p>
  
  <p>x-axis is hardly readable.</p>
  
  <p>Is there a way to set distance for every x-axis unit so it could extend the plot automatically (on x direction)?</p>