title: Show only first and last ticks label of x-axis plot
body: <p>I'm parsing a log file and creating a plot.</p>
  
  <p>I don't need all labels on X axis. I want to display only a first one and a last one or a few of them with particular step let's say every 100.</p>
  
  <p>How I can do this? I can display only first one or only last one but not both together. </p>
  
  <p>My code:</p>
  
  <pre><code>import numpy as np
  import pylab as pl
  import matplotlib.pyplot as plt
  
  with open('file.log') as f:
      lines = f.readlines()
      x = [int(line.split(',')[0]) for line in lines]
      my_xticks = [line.split(',')[1] for line in lines]
      y = [int(line.split(',')[2]) for line in lines]
      z = [int(line.split(',')[3]) for line in lines]
  
  plt.xticks(x, my_xticks[0], visible=True, rotation="horizontal")
  plt.xticks(x, my_xticks[-1], visible=True, rotation="horizontal")
  
  plt.plot (x,z)
  plt.plot (x,z)
  plt.plot(x, y)
  
  
  plt.show()
  </code></pre>
  
  <p>Thank you!</p>