Matplotlib: how to control the plot interval of x axis?
<p>I'm plotting the <code>degree of freedom</code> against the <code>square error</code>,:</p>

<pre><code>plt.plot([1,2,3,4], [0.5,0.6,0.9,0.85],'-')
</code></pre>

<p>It will produce</p>

<p><a href="https://i.stack.imgur.com/ELpnk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ELpnk.png" alt="enter image description here"></a></p>

<p>The problem is that ,the x ax is has 0.5 interval, and does not make sense in this context. Because there is simply no 1.5 degree of freedom.</p>

<p>How can I make the x axis into [1,2,3,4,], instead of [1, 1.5, 2, ...]?</p>