Display interpreted functions.
Author: Rene Brun
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, March 19, 2024 at 07:09 PM.
TCanvas *c1 = new TCanvas("c1","Example with Formula",200,10,700,500);
We create a formula object and compute the value of this formula for two different values of the x variable.
auto form1 = new TFormula("form1","sqrt(abs(x))");
form1->Eval(2);
form1->Eval(-45);
Create a one dimensional function and draw it
auto fun1 = new TF1("fun1","abs(sin(x)/x)",0,10);
c1->SetGridx();
c1->SetGridy();
fun1->Draw();
c1->Update();
Before leaving this demo, we print the list of objects known to ROOT
if (gObjectTable) gObjectTable->Print();
Object statistics class cnt on heap size total size heap size ================================================================================ TList 135 134 104 14040 13936 TObjectTable 1 1 32 32 32 TROOT 1 0 728 728 0 TPluginManager 1 1 40 40 40 THashTable 2 2 72 144 144 TClassTable 1 1 16 16 16 THashList 1 1 112 112 112 TEnv 1 1 56 56 56 TEnvRec 147 147 96 14112 14112 TNamed 1 1 64 64 64 TUnixSystem 1 1 672 672 672 TOrdCollection 4 4 72 288 288 -------------------------------------------------------------------------------- Total: 296 294 2064 30304 29472 ================================================================================
Draw all canvases
%jsroot on
gROOT->GetListOfCanvases()->Draw()