How to modify a histogram

Hi, i have to plot the values of a branch of a TTree.
i used this script

int run() { gROOT.Reset(); TFile *myfile = TFile::Open("mu0_1GeVtheta0.root","UPDATE");//thank you pcanal! TH1F* FreqPEtot=new TH1F(2600); FreqPEtot->GetYaxis()->SetTitle("Freq"); dispersione->SetMarkerStyle(3); FreqPEtot->SetTitle("Freq PE tot mu 0.1GeV (0,0,0) theta,phi =0"); dispersione->Draw("PETot>>FreqPEtot()","","p0"); //FreqPEtot->Write(); return 0; }

Here dispersione is the name of the TTree and PETot is the branch i want to plot.

the plot is correct, but i’m not able to set the title of the axis nor the title of the histogram.
What am i missing?
Amir

Hi Amir,

The histogram and axis titles can be created via the user interface available in the recent root versions. Please see the chapters "The user interface for histograms’ (page 45) and “TaxisEditor” (page 126) included in the new User’s Guide v.4.04 at: root.cern.ch/root/doc/RootDoc.html

Cheers, Ilka

thank you for the reply Ilka
i was searching a way to build a script to do it, because there are many .root files to open and modify.
I’ll do it by hand via graphical interface with some patience :smiley: :smiley: :smiley: