User Tools

Site Tools


root:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
root:python [2009/12/08 09:59]
viktorh
root:python [2014/02/12 16:17] (current)
nchiap [TGraph]
Line 4: Line 4:
         ​         ​
         from ROOT import *         from ROOT import *
-        from array import array+        from numpy import array
         x = [1,​2,​3,​4] ​ # a list          x = [1,​2,​3,​4] ​ # a list 
         y = [5,​6,​7,​8] ​ # a list         y = [5,​6,​7,​8] ​ # a list
-        graph = TGraph(len(x),​array('​f'​,x),​array('​f'​,y)) # convert lists to arrays+        graph = TGraph(len(x),​array(x,'​f'​),​array(y,'​f'​)) # convert lists to arrays
root/python.txt ยท Last modified: 2014/02/12 16:17 by nchiap