I have two histograms h1 and h2 that I’m plotting using sames.
I’d like to move the stats boxes on the canvas, and from the TPaveStats class reference it seems I should use SetX(Y)1NDC. However this sends my macro into seg fault, telling me: warning: null passed to a callee that requires a non-null argument.
How can I do this? I’m using Root 6.
TH1F *h1 = (TH1F*)_file0->Get("h1");
TH1F *h2 = (TH1F*)_file0->Get("h2");
TCanvas* c1 = new TCanvas("c1","c1",900,700);
h1->Draw();
h2->Draw("sames");
TPaveStats *Stats1 = (TPaveStats*)h1->FindObject("stats");
TPaveStats *Stats2 = (TPaveStats*)h2->FindObject("stats");
Stats1->SetX1NDC(570);