Hi, Replace your statement: h2.Fit("gaus", "", "SAME"); by h2.Fit("gaus", "", "SAMES"); see Users Guide page 32 or http://root.cern.ch/root/htmldoc/THistPainter.html#THistPainter:Paint at secion "Statistics Display" Rene Brun margar@atlas.yerphi.am wrote: > > Dear Rooters > > I would like to draw 2 TPaveStats objects in the same pad and I have > found some solution in ROOT Users Guide but it doesn't work. > Below one can find part of the macro. > > gStyle->SetOptFit(1); > h1.Draw(""); > h1.Fit("gaus", "", "SAME"); > TPaveStats * ps1 = (TPaveStats > *)h1.GetListOfFunctions()->FindObject("stats"); > if(ps1) { > ps1->SetX1NDC(0.1); > ps1->SetX2NDC(0.5); } > else > cout<<"something wrong with ps1"<<endl; > > h2.Draw("SAME"); > h2.Fit("gaus", "", "SAME"); > TPaveStats * ps2 = (TPaveStats > *)h2.GetListOfFunctions()->FindObject("stats"); > if(ps2) { > ps2->SetX1NDC(0.5); > ps2->SetX2NDC(0.9); } > else > cout<<"something wrong with ps2"<<endl; > > and I always get message "something wrong with ps2". > > P.S. I am using 3.10/01 (gcc-2.9.6) version of ROOT on CERN Linux 7.3.3 > > Thanks, > Margar
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET