I superimpose two histograms:
TH1F *data1 = new TH1F("without_KF", "without_KF",100,0,400 );
TH1F *data2 = new TH1F("with_KF", "with_KF",100,0,400);
Next I want to set Title in result picture. By default it is the name of the 1st drew hist. And I cannot change it. How to set Title in this case properly?
The simplest is to change the title of the histogram
data1, either at creation time or using
It is bad because I set Legend and if I change title of the hist
data1 then in legend it will be too.
auto h1 = new TH1D("h1","h1",100,-2.,2.);
auto h2 = new TH1D("h2","h2",100,-2.,2.);
TPaveText* pt = (TPaveText*)gPad->FindObject("title");
TPaveText* ptn = new TPaveText(pt->GetX1(),pt->GetY1(),
Though it looks like not the way it works and I do not have any alternative. Thank you.
One more. I want to enlarge text. But if I try ptn->SetTextSize(number) I get no text at all.
How to set text size?
Sorry it seems like number should be less than zero? Sorry.
To enlarge the title you should specify the ton box larger. X1 smaller and X2 bigger.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.