title: x-axis ticks change location when data is None - matplotlib
body: <p>I plotted a list using:</p>
  <pre><code>fig = plt.figure(1)
  ax1 = fig.add_subplot(111)
  ax1.plot(range(samples_per_ant[0]), new_y[:samples_per_ant[0]], '-o', linewidth=3)
  </code></pre>
  <p>The result is that the ticks are in the right positions, equally spaced in between and from the plot's frame (i can't add a picture to share).</p>
  <p>But when i want to change the ticks i used:</p>
  <pre><code>ax1.set_xticks(range(samples_per_ant[0]), case[:samples_per_ant[0]])
  </code></pre>
  <p>since the last few elements in list &quot;new_y&quot; are &quot;None&quot;, such as</p>
  <pre><code>new_y = [1, 2, 3, ... , None, None, None]
  </code></pre>
  <p>it looks like it &quot;stretched&quot; the x-axis a bit and the ticks got to the right edge of the frame (no space from the edge, as supposed to be).</p>
  <p>How can i plot it and keep the ticks in place?</p>