Hi ROOT experts!
I want to write a simple text over hist (TH1D/TH2D) without TCanvas. There are many histograms in a root file and I want to write text over some of the histograms available in the root file. Pls, suggest any hint. Thanks in advance.
_Compiler:_c++ (GCC) 12.2.0
I am not sure I fully understand your problem. The text will be shown when you plot the histogram, so it will be in a ROOT Canvas. You would like to append text in the class that is automatically visible when displaying the histogram ?
I got solution. It is in this way …
TFile* file = new TFile("file.root","recreate");
TH1D* h1=new TH1D("h1","h1",10,-5,5);
TRandom* rng =new TRandom();
TPaveText* msg1 = new TPaveText(0.1,0.8,0.2,0.9,"NDC"); // check option "br","NDC"
msg1->AddText("Gaussian Dist 1");
Thanks for reply.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.