TProfile stats box display mean/sd for only one axis

Hi ROOT,

I want to display the mean and standard deviation for only one of the axes. Is there a method or option I can set to do this?

Thanks

Use gStyle->SetOptStat() to define what you want to see in the stat box.
There is many example $ROOTSYS/tutorials

From what I understand I can either turn showing the mean for boths axis on or off but not one on and one off.

e.g. show y mean but not x mean

Yes, that’s it. You can also fill the stats box with the information you want like in the following example:

void mystats() {
   TCanvas *c1 = new TCanvas;
   TH1F *h = new TH1F("h","test",100,-3,3);
   h->FillRandom("gaus",3000);
   gStyle->SetOptStat();
   h->Draw();
   c1->Update();
   TPaveStats *ps = (TPaveStats*)c1->GetPrimitive("stats");
   ps->SetName("mystats");
   TList *list = ps->GetListOfLines();
   TText *tconst = ps->GetLineWith("RMS");
   list->Remove(tconst);
   TLatex *myt = new TLatex(0,0,"test = 10");
   list->Add(myt);
   h->SetStats(0);
   c1->Modified();
}