|
From: nittopuran n. <nit...@gm...> - 2013-03-05 12:12:12
|
Hi,
I have this script which gives output the image attached here. What I want
is to give all the peak a number on top of the peak like 1 for first peak,
2 for second, 3 for third and so on. Could someone pls help me how to do
that in python.
The 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')
title('Cer2.Chol.Ffa7 (1.1.1)')
plt.show()
/Tatiana
|