Illegal pointer to stats box in TGraphErrors

Hello,

I’m trying to access the stats box of a function from a TGraphErrors graph but I’m getting a null pointer for the stats box object.

Below you can find a code which reproduces the problem.

I try to follow this post

[url]Statistics box illegal pointer

as it showed the same problem, but I couldn’t manage to solve it

I guess maybe I’m doing a stupid mistake. Can someone have a look please?

ROOT version 5.32/04

Kind regards,
Luís.

statsbox.cc (567 Bytes)
graph.root (8.65 KB)

You are missing something like: gStyle->SetOptFit();
Have also a look at:
TStyle::SetOptStat(Int_t stat = 1)
TStyle::SetOptStat(Option_t* stat)
TStyle::SetOptFit(Int_t fit = 1)

[quote=“Wile E. Coyote”]You are missing something like: gStyle->SetOptFit();
Have also a look at:
TStyle::SetOptStat(Int_t stat = 1)
TStyle::SetOptStat(Option_t* stat)
TStyle::SetOptFit(Int_t fit = 1)[/quote]

Thanks a lot Wile =D> As I said it was a stupid mistake #-o :blush:

Cheers,
L.