Logo ROOT   6.07/09
Reference Guide
Namespaces
formula1.py File Reference

Namespaces

 formula1
 

Detailed Description

View in nbviewer Open in SWAN TF1 example.

pict1_formula1.py.png
1 
2 from ROOT import TCanvas, TFormula, TF1
3 from ROOT import gROOT, gObjectTable
4 
5 c1 = TCanvas( 'c1', 'Example with Formula', 200, 10, 700, 500 )
6 
7 # We create a formula object and compute the value of this formula
8 # for two different values of the x variable.
9 form1 = TFormula( 'form1', 'sqrt(abs(x))' )
10 form1.Eval( 2 )
11 form1.Eval( -45 )
12 
13 # Create a one dimensional function and draw it
14 fun1 = TF1( 'fun1', 'abs(sin(x)/x)', 0, 10 )
15 c1.SetGridx()
16 c1.SetGridy()
17 fun1.Draw()
18 c1.Update()
19 
20 # Before leaving this demo, we print the list of objects known to ROOT
21 #
22 if ( gObjectTable ):
23  gObjectTable.Print()
Author
Wim Lavrijsen

Definition in file formula1.py.