2009年7月22日水曜日

How to user pyROOT 応用編 その6

・軸を log スケールにする

  1. cv = ROOT.TCanvas("cv""Graph Test"800800)  
  2.   
  3. cv.SetLogx()  
  4. cv.SetLogy()  



・grid を描く

  1. cv = ROOT.TCanvas("cv""Graph Test"800800)  
  2.   
  3. cv.SetGridx()  
  4. cv.SetGridy()  



・大題を付ける

  1. cv = ROOT.TCanvas("cv""Graph Test"800800)  
  2.   
  3. pl = ROOT.TPaveLabel(0.30.910.70.99"Global Title")  
  4. pl.Draw()  
  5.   
  6. pad = ROOT.TPad("pad""title"0010.9)  
  7. pad.Draw()  
  8. pad.cd()  
  9.   
  10. graph.Draw("APL")  
  11.       
  12. cv.Update();  






・X軸, Y軸のタイトルを修飾

  1. axisX = graph.GetXaxis()  
  2. axisX.SetTitle("x")  
  3. axisX.SetLabelFont(112)  
  4. axisX.SetTitleOffset(0.5)  
  5. axisX.SetTitleSize(0.07)  
  6.   
  7. axisY = graph.GetYaxis()  
  8. axisY.SetTitle("x**2")  






・ヒストグラムの修飾

  1. hpx.SetFillColor(2)  
  2. hpx.SetLineWidth(5)  





  1. hp1.SetFillColor(2)  
  2. hp1.SetFillStyle(3002)  
  3. hp1.Draw()  
  4.   
  5. hp2.SetFillColor(4)  
  6. hp2.SetFillStyle(3002)  
  7. hp2.Draw("SAME")  






・マーカーの修飾

  1. graph = ROOT.TGraph()  
  2. graph.SetMarkerColor(6)  
  3. graph.SetMarkerSize(1)  
  4. graph.SetMarkerStyle(12)  

0 件のコメント:

コメントを投稿