[ Home ] [ Back ]

Contents
  • Introduction

Keywords:

Scriptini utili per analisi dati

./configure linux --enable-python
setenv ROOTSYS /opt/root
setenv PYTHONPATH $ROOTSYS/bin
from ROOT import TGraph

plot = TGraph("filename","%lg %lg")
# plot = TGraph("filename","%lg ; %lg")     # csv values

plot.Draw("ALP")
3.14159
2.71828
1.61803
...
...
#!/usr/bin/env python

from ROOT import TH1F

file = open("data.dat","r")
histo = TH1F("histo","histo",100,-5,5)

for line in file:
   xval = float(line.split("\n")[0])
   histo.Fill(xval)

histo.SetTitle("Title")
histo.GetXaxis().SetTitle("x-axis")
histo.GetYaxis().SetTitle("y-axis")
histo.Draw("options")

file.close()
raw_input()
3.14159 ; ...
2.71828 ; ...
1.61803 ; ...
...     ; ...
...     ; ...



Last update:

  • vlsi/workbook/analysis/python.txt
  • Ultima modifica: 20/08/2013 20:37
  • da pacher