ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
formula1.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphics
3 /// Display interpreted functions.
4 ///
5 /// \macro_image
6 /// \macro_code
7 ///
8 /// \author Rene Brun
9 
10 void formula1() {
11  TCanvas *c1 = new TCanvas("c1","Example with Formula",200,10,700,500);
12  //
13  // We create a formula object and compute the value of this formula
14  // for two different values of the x variable.
15  //
16  auto form1 = new TFormula("form1","sqrt(abs(x))");
17  form1->Eval(2);
18  form1->Eval(-45);
19  //
20  // Create a one dimensional function and draw it
21  //
22  auto fun1 = new TF1("fun1","abs(sin(x)/x)",0,10);
23  c1->SetGridx();
24  c1->SetGridy();
25  fun1->Draw();
26  c1->Update();
27  //
28  // Before leaving this demo, we print the list of objects known to ROOT
29  //
31 }
virtual void SetGridx(Int_t value=1)
Definition: TPad.h:327
void Print(Option_t *option="") const
Print the object table.
tuple form1
Definition: fillrandom.py:24
The F O R M U L A class.
Definition: TFormula.h:89
R__EXTERN TObjectTable * gObjectTable
Definition: TObjectTable.h:84
The Canvas class.
Definition: TCanvas.h:48
virtual void SetGridy(Int_t value=1)
Definition: TPad.h:328
tuple fun1
Definition: formula1.py:18
1-Dim function class
Definition: TF1.h:149
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2179