Matplotlib User (I'm not sure how to address you),

I think that you are looking for either text() or annotate().

-Sterling


On Mar 5, 2013, at 4:12AM, nittopuran natya wrote:

> 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
> <d012_SAXS-recomb.txt><image.png>------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb_______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to