Hello!
I have some problems.
I want to save two hist on a single canvas.
I know how to save one hist on a single canvas.
For example (from input / output chapter in guide):
char name[10], title[20];
TObjArray Hlist(0); // create an array of Histograms
TH1F* h; // create a pointer to a histogram
// make and fill 15 histograms and add them to the object array
for (Int_t i = 0; i < 15; i++) {
sprintf(name,"h%d",i);
sprintf(title,"histo nr:%d",i);
h = new TH1F(name,title,100,-4,4);
Hlist.Add(h);
h->FillRandom("gaus",1000);
}
// open a file and write the array to the file
TFile f("demo.root","recreate");
Hlist->Write();
f.Close();
So, I will have 15 single histograms.
prntscr.com/890mlb
I want to save two (or more) histograms on a single canvas.
I.e. I want to have something like this:
aholzner.files.wordpress.com/20 … histos.png
If I use Hlist.Add(h_1) and then Hlist.Add(h_2), I have two histograms and two canvas.
If I use h_1->Draw() and then h_2->Draw(), root will draw histograms in real time, but I just want to save them in file.
Could you help me?