import ROOT, glob, math, sys, os import argparse from ROOT import std from array import array import numpy as np parser=argparse.ArgumentParser(description="starts the calculator for the deviation map.") parser.add_argument("files",help="file") args = parser.parse_args() ROOT.gROOT.ProcessLine(".x rootlogon.C") ROOT.gROOT.ProcessLine('gStyle->SetPalette(1)') ROOT.gROOT.ProcessLine('gROOT->SetStyle("Plain")') c1 = ROOT.TCanvas("c1", "test", 700,1000) c2 = ROOT.TCanvas("c2", "test", 700,1000) c3 = ROOT.TCanvas("c3", "test2", 700,1000) testfile=np.genfromtxt(args.files,names=["x", "y", "z"]) print testfile graphX=ROOT.TGraph() graphX.SetMarkerColor(2) graphX.SetMarkerSize(0.2) graphX.SetMarkerStyle(20) graph=ROOT.TGraph() graph.SetMarkerColor(2) graph.SetMarkerSize(0.2) graph.SetMarkerStyle(20) points=ROOT.TPolyMarker3D() hist3d=ROOT.TH3D("hist","hist",30,-15,15,30,-15,15,75,0,75) bins=0 for xr in range(len(testfile)): #print testfile["x"][xr], testfile["y"][xr] graphX.SetPoint(bins, testfile["x"][xr], testfile["y"][xr]) graph.SetPoint(bins, testfile["y"][xr], testfile["z"][xr]) points.SetPoint(xr,testfile["x"][xr], testfile["y"][xr], testfile["z"][xr]) bins+=1 c1.cd() graphX.Draw("AP") c1.Update() c2.cd() hist3d.Draw() points.Draw("same") c2.Update() c3.cd() graph.Draw("AP") c3.Update() x = raw_input()