RE: [ROOTDEV] TPaveStats

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 21 Mar 2011 10:07:57 +0000


Try this:

{

TCanvas* c=new TCanvas();

TH1F* hist = new TH1F("hist", "hist", 100, -5, 5);

hist->FillRandom("gaus",10000);

hist->Draw();

hist->Fit("gaus", "", "", -3, 3);

gPad->Update();

TPaveStats *st =

(TPaveStats*)hist->GetListOfFunctions()->FindObject("stats");

st->SetX1NDC(.2);

st->SetX2NDC(.4);

gPad->Update();

c->Modified();

}

From: owner-rootdev_at_root.cern.ch [mailto:owner-rootdev_at_root.cern.ch] On Behalf Of ??? Sent: Monday, March 21, 2011 10:45 AM
To: rootdev_at_root.cern.ch; roottalk_at_root.cern.ch Subject: [ROOTDEV] TPaveStats

Hi all,

i want to change the position of TPaveStats using codes as follows:

 TCanvas* c=new TCanvas();

    TH1F* hist = new TH1F("hist", "hist", 100, -5, 5);

    hist->FillRandom("gaus",10000);
    hist->Draw();
    hist->Fit("gaus", "", "", -3, 3);
    gPad->Update();

    TPaveStats *st = (TPaveStats*)hist->FindObject("stats");
    st->SetX1(2);
    st->SetY1(300);
    st->SetX2(4);
    st->SetY2(400);

    //st->UseCurrentStyle();
    gPad->Update();
    c->Modify();

but nothing happens, could you please tell me how to set the position of TPaveStats

Thank you! Received on Mon Mar 21 2011 - 11:08:04 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 21 2011 - 17:50:01 CET