Statistics box with TEffeciency

Hello everyone,

I am trying to remove the statistics box of an efficiency graph. gStyle->SetOptFit(0) does not work. I have also tried to manipulate the box while running root interactively but I can not grab the box or do anything to it. How can I do this?

Thanks,

Jose.
P.S. Here is a snippet of the code I use to make the attached figure:

    TEfficiency* pEff = 0;

if (TEfficiency::CheckConsistency(*h_pass,*h_tot)) {
	pEff = new TEfficiency(*h_pass,*h_tot);
}
pEff->Draw();

    gStyle->SetOptStat(0); 
    gStyle->SetOptFit(0); 

TF1* f1 = new TF1("f1","pol0",0,50);
f1->SetLineWidth(3);

pEff->Fit(f1);
pEff->SetStatisticOption(TEfficiency:: kFCP);
pEff->Draw();
gPad->Update();
pEff->GetPaintedGraph()->GetYaxis()->SetTitle("Efficiency");
pEff->GetPaintedGraph()->SetMinimum(0.75);
pEff->GetPaintedGraph()->SetMaximum(1.05);
pEff->GetPaintedGraph()->GetXaxis()->SetTitle("N_{PV}");
pEff->SetMarkerStyle(20);
pEff->SetMarkerSize(1.4);
cout << "Making the text" << endl;
pEff->Write();
pEff->Draw("ap");

    tl->SetTextSize(0.04); 
cout << "after setting text size" << endl;
tl->DrawLatex(0.18, 0.91, Form("Prob = %4.3f", 
							   f1->GetProb()));

tl->DrawLatex(0.45, 0.91, Form("Cut = %5.4f", cut));

    tl->SetTextSize(0.05); 
    tl->DrawLatex(0.25, 0.82, Form("#chi^{2}/dof = %3.1f/%i", 
							 f1->GetChisquare(),
							 f1->GetNDF()));

   c0->SaveAs(Form("%s/effVsNpv-%s-%s-%s-%s-0_%d.pdf", fDirectory.c_str(), fFile.c_str(), dir, chan, var, static_cast<int>(100.*cut)));

effVsNpv-CsData-candAnaBs2JpsiPhi-A-alpha-0_5.pdf (15.3 KB)

Looking at the doc it seems TEfficiency ends up being a TGraph. In principal there is no stats box attached to a TGraph.That’s confirmed by all the plots you can see here: root.cern.ch/root/html/TEfficiency.html
Can you send a small running example showing this effect (what you sent is only a snippet we cannot run).

Dear,

Was there a solution ever found to this problem ?

I am encountering the same issue: I want to make the fit box (which contains Chi2 and fit parameter values) disappear from a plot.
I am trying gStyle -> SetOptFit(0) place in several places to be sure, but it does not help.

Even issueing a gPad->Update() does not help.

Best,
Nadir

Hi,

This problem should be fixed now in the ROOT master. Thank you for reporting it

Lorenzo