python/matplotlib : imposed ticks with ticker partially missing
<p>When plotting my figure with <code>plt.axis('auto')</code>, 'natural' x-ticks are written with frequency 500,</p>

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

<p>Wishing a frequency 200, I have used:</p>

<pre><code>    import matplotlib.ticker as ticker

    ticks_loc = ticker.MultipleLocator(base=200)

    fig = plt.figure('Cutlines x-axis')
    ax = fig.add_subplot(111)
    ...
    plt.axis('equal')
    ax.xaxis.set_major_locator(ticks_loc)
    ax.yaxis.set_major_locator(ticks_loc)
    plt.grid()
</code></pre>

<p>which gives,</p>

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

<p>Curiously </p>

<ol>
<li>all the ticks are not represented (ticks -1000, -800, -600 are missing) </li>
<li><code>plt.show()</code> differs from <code>savefig</code> (in <code>plt.show()</code> 'only' ticks -1000 and -800 are missing, not -600).</li>
</ol>

<p>I have tried reducing the font size (with very tiny one) and/or by writing vertically -> no effect : always the same ticks are missing.</p>

<p>Is there a way to have all the ticks visible (in horizontal mode) ?</p>

<p>Why don't you simply use <code>xticks</code> instead of <code>ticker</code></p>

<pre><code>fig = plt.figure('Cutlines x-axis')
ax = fig.add_subplot(111)
...
xlim = ax.get_xlim()
plt.xticks(np.arange(xlim[0], xlim[1]+200, 200))
</code></pre>

python matplotlib ticker