Dear ROOT experts,
Using root 5.12/00a (same however in root 5.14/00) I have the next problem:
I divide a canvas in a variable number of pads. Then in a loop I want to select a certain pad, but this does not work, the main canvas stays selected with the result that all histograms are drawn in the main canvas, totally neglecting my wish for pads.
Does anyone know a solution to this problem?
Many thanks in advance,
Ytsen.
PS. Example below reproduces the problem. The desired output would be a canvas, split in 10 pads (vertically allocated) and all histos cosths0 to cosths9 in the respective pads …
{
gROOT->Reset();
const Int_t binsTHETA = 10;
TH1F hncosths[binsTHETA];
for (Int_t i = 0; i < binsTHETA; ++i) {
TString scosths;
scosths.Form(“hcosths%i”, i);
hncosths[i] = TH1F(scosths, scosths, 10, -1, 1);
};
TCanvas cArray(“cArray”,“cArray”,0,0,1000, 800);
cArray.Divide(1, binsTHETA);
for (Int_t i = 0; i < binsTHETA; ++i) {
cArray.cd(i);
hncosths[i].DrawClone();
};
};