TCanvas *se = new TCanvas; TH1F *h = new TH1F("h","test",100,-3,3); h->FillRandom("gaus",3000); gStyle->SetOptStat(); h->Draw(); se->Update(); TPaveStats *ps = (TPaveStats*)se->GetPrimitive("stats"); ps->SetName("mystats"); TList *listOfLines = ps->GetListOfLines(); TText *tconst = ps->GetLineWith("RMS"); listOfLines->Remove(tconst); TLatex *myt = new TLatex(0,0,"Test = 10"); myt ->SetTextFont(42); myt ->SetTextSize(0.04); myt ->SetTextColor(kRed); listOfLines->Add(myt); h->SetStats(0); se->Modified(); return se; gROOT->GetListOfCanvases()->Draw()