Dear all!
I want to draw several histograms seperately with the help of the “pads” option of THStack. This works fine although I don’t manage to set to logarithmic scale. Please see the following example:
log() {
TH1* h1 = new TH1F("h1","h1",100,-5,5);
h1->FillRandom("gaus");
h1->SetLineColor(kRed);
TH1* h2 = new TH1F("h2","h2",100,-5,5);
h2->FillRandom("gaus");
h2->SetLineColor(kBlue);
THStack* stack = new THStack("hstack","hstack");
stack->Add(h1);
stack->Add(h2);
c2 = new TCanvas("c2","c2");
stack->Draw("pads");
c2->cd(1);
gPad->SetLogy();
//gPad->SetLogy(1); // same
gPad->Modified();
gPad->Update();
}
If I run it with ROOT 5.30.00 the y axis is not logarithmic but stays linear.
Could you please give me a hint what I’m missing?
Thanks a lot,
Sebastian