Fit Option "O"

Hi guys,

at some point in my code I want to fit several TH1Is:

TF1 *fit = new TF1(name.c_str(), "gaus" , -5 , 5 );
fit->SetParameter(1, 0);
PointerToHist->Fit(fit, "RQO");

Although I specify the Option “O” (Is it the letter or zero? Both did not work.), I get the info:

Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1

and a Canvas is opened. I don’t want it to be drawn, I just want to fit? What am I doing wrong?
I want to keep the fit and the graphical info to draw the histograms at a later time though.
I’m linking against root v6-04-02 and compiling with gcc 4.84 on Ubuntu 14.04.
Thx,

Try: { TH1F *h = new TH1F("h", "h", 100, -5, 5); h->FillRandom("gaus"); TF1 *f = new TF1("f", "gaus", -5 , 5); // search for: Warning when using the option "0" // in: https://root.cern.ch/root/html534/TH1.html#TH1:F@1 h->Fit(f, "RQ0"); // h->Fit(f, ""); }

Thx Pepe Le Pew,

what was written in the link actually works:

h.Fit("myFunction", "0"); // fit, store function but do not draw
h.Draw(); function is not drawn
const Int_t kNotDraw = 1<<9;
h.GetFunction("myFunction")->ResetBit(kNotDraw);
h.Draw();  // function is visible again