title: Giving peak number to the plot
body: <p>I have the following script which reads the ascii file of two columns and generates 1D plot. The graph has several peaks. What I want is to give all the peak a number like first peak 1, second peak 2 and so on. The peaks appear in an equidistant position in X axis. Can someone tell me how to do that in python. The code- </p>
  
  <pre><code>from pylab import*
  
  
  # Read the file. 
  f2 = open('d012_SAXS-recomb.txt', 'r')
  
  # read the whole file into a single variable, which is a list of every row of the file.
  lines = f2.readlines()[2:-100]
  
  f2.close()
  
  
  # initialize some variable to be lists:
  x1 = []
  
  y1 = []
  
  
  # scan the rows of the file stored in lines, and put the values into some variables:
  for line in lines:
  
      p = line.split()
  
      x1.append(float(p[0]))
  
      y1.append(float(p[1]))
  
  
  x = np.array(x1)
  
  y = np.array(y1)
  
  
  xlim(0.0,4.0)
  
  
  # now, plot the data:
  #subplot(211)
  plt.plot(x, y, color='orange',linewidth=2.0, linestyle='-', label='Arabic - LPP''\nRoman - SPP''\nAsterisk - CHOL')
  legend(loc='upper right')
  
  xlabel('q')
  
  ylabel('Intensity')
  
  plt.show()
  </code></pre>