12 from __future__
import print_function
13 from ROOT
import TCanvas, TGraph
14 from ROOT
import gROOT
16 from array
import array
19 c1 = TCanvas(
'c1',
'A Simple Graph Example', 200, 10, 700, 500 )
25 x, y = array(
'd' ), array(
'd' )
29 y.append( 10*sin( x[i]+0.2 ) )
30 print(
' i %i %f %f ' % (i,x[i],y[i]))
32 gr = TGraph( n, x, y )
35 gr.SetMarkerColor( 4 )
36 gr.SetMarkerStyle( 21 )
37 gr.SetTitle(
'a simple graph' )
38 gr.GetXaxis().SetTitle(
'X title' )
39 gr.GetYaxis().SetTitle(
'Y title' )
44 c1.GetFrame().SetFillColor( 21 )
45 c1.GetFrame().SetBorderSize( 12 )