On Wed, Aug 12, 2009 at 12:22 PM, <spielm...@th.physik.uni-frankfurt.de> wrote:
> hmm ok i post it in a more shorter way... but with the point raw settings
> i dont know how it should works

I directed you to the documentation.

An improved script is attached.
#!/usr/bin/python
# -*- coding: utf8 -*-

import numpy as np
import pylab as pl
import string
import matplotlib
import scipy as sp
from scipy import stats
#from matplotlib import rc
matplotlib.rcdefaults()
matplotlib.rc('text', usetex = False)


# funktion zum einlesen der daten
def readXY(filename):

   x,y = np.loadtxt(filename, unpack=True)
   return x,y
   
# funktion
def kpfit(x):
	return (4.3793709787705581e-06+7.8272225529223599e-07*x)

def kmfit(x):
	return -4.8707876140789696e-08+3.196543428131772e-09*x

#(x_a, y_a) = readXY("mK-massnumbera.dat")
#(x_b, y_b) = readXY("mK-massnumberb.dat")

#x = pl.array([ 0, 50, 100, 200])
#pkfitx = pl.array( [0, 200 ])
#xx = np.linspace(0,250, 500)
#xx1 = np.linspace(20,250, 500)

# berechnen
#y_a[0]=y_a[0]/6.0
#y_a[1]=y_a[1]/12.0
#y_a[2]=y_a[2]/24.0
#y_a[3]=y_a[3]/58.0
#y_a[4]=y_a[4]/107.0
#y_a[5]=y_a[5]/197.0

#y_b[0]=y_b[0]/24.0
#y_b[1]=y_b[1]/58.0
#y_b[2]=y_b[2]/107.0
#y_b[3]=y_b[3]/197.0

#m,b = np.polyfit(x_a,y_a,1)
#m1,b1 = np.polyfit(x_b,y_b,1)
#print(xx, kpfit(xx))
#print(m1,b1)
#(a_s,b_s,r,tt,stderr)=stats.linregress(t,x_a)


# plotten
#pl.plot(x_a, y_a, 'ro')
#pl.plot(x_b, y_b, 'b^', linewidth=3.0)
#pl.plot(xx, kpfit(xx), 'r-', lw=2)
#pl.plot(xx1, kmfit(xx1), 'b-', lw=2)
#pl.plot(t, x_a,'--k')
pl.plot(range(0,170))
pl.plot(range(10,180))
pl.axis([-50.0 , 300.0 , 0.0000000001 , 1])
#pl.semilogy()
pl.xlabel(r'$Massnumber A$', {'color' : 'b', 'fontsize' : 20 })
pl.ylabel(r' $\bar a   M_{K} / <A_{part}> $', {'color' : 'b', 'fontsize' : 20 })
pl.text(170.0, 0.00000001, r'$\sqrt{s}=2.30 \ GeV$', fontsize=20)
pl.text(170.0, 0.000000001, r'$imp. \ 0.0$', fontsize=20)
#pl.text(2.8, 0.1, r'$K^{+}testest$', fontsize=20)

#legende
pl.legend((r'$K^{+}$', r'$K^{-}$'), loc = 'upper left')
ltext = pl.gca().get_legend().get_texts()
pl.setp(ltext[0], fontsize = 20, color = 'r')
pl.setp(ltext[1], fontsize = 20, color = 'b')

#pl.figsize(5, 5)

pl.savefig('mK_massnumber1ps')
pl.savefig('mK_massnumber1.eps')
pl.show()

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to