Opening two .root file in the same canvas

Sorry, in the previous macro you should do:

st->Draw(“nostack”);

instead of:

st->Draw();

You will get this:

Great Thanks for your Help

Hello again,

Could you please also kindly help me in how to put label for my axes in ur script?

Thank you in advance

You mean axis title ?
it is something like:
h->GetXaxis()->SetTitle(…);
Check the doc …

Yes I meant axis titles.
Could you please have a look at the enclosed script. I added the axis titles as well as another box using

[code]pt = new TPaveText(0.20,0.7,0.5,0.87, “NDC”);

text = pt->AddText(“Energy Deposition”);[/code]

But while I run essai2.C no change is observable!
essai2.C (827 Bytes)

{
   TFile f1("essai1.root");
   TH1D *h1=f1.Get("2");
   TFile f2("essai2.root");
   TH1D *h2=f2.Get("2");
   TFile f3("essai3.root");
   TH1D *h3=f3.Get("2");
   
   h2->SetLineColor(kRed);
   h3->SetLineColor(kGreen);

   h1->SetTitle("Galactic emlivermore and elastic");
   h2->SetTitle("water emlivermore and elastic");   
   h3->SetTitle("water emlivermore");

   THStack *st = new THStack();
   st->Add(h1);
   st->Add(h2);
   st->Add(h3);

   st->Draw("nostack");
   
   st->GetXaxis()->SetTitle("This is my X title");
   st->GetYaxis()->SetTitle("This is my Y title");
   
   gPad->BuildLegend();
}

I have the same thing here … I would like to join two files together … I am using GAMOS and ROOT …

I actually have no knowledge about ROOT at all … I only get histograms from GAMOS …

GAMOS outputs histograms in ROOT format … Each run produces one histogram.root

I would really appreciate it if someone teaches me this step by step … The things said about are OK to me , but where do I type all of these lines ? Right in terminal ?

Also, I am not sure I should know how to code in C++ to do any of the things said above … Please advise …

Thanks,

ROOT User Guides and Manuals