Histograms disappear with THStack of many TH2D's

Dear all,

for an application, I want to print many (order of 30) 2d histograms each with a different color into one plot. THStack is supposed to do the job. For a few 2d histograms, this works like charm.

However, for a THStack of more than 18 histograms, only the axes are plotted, no histogram at all are plotted. Below, you’ll find a small demo. This fails on several platforms and several root versions, e.g. slc and root 4.03 and 5.02.

Related to this, I’d like to plot each 2d histogram in only one color. The first 8 histograms, the front and the side have similar colors, but the others do have different colors. Even when setting the color of all histograms to the same color, e.g. h->SetFillColor(40), the front and the side for some of the histograms do differ, namely for them added to THStack after the first 8 histos.

Any help is appreciated,

cheers, Rolf

{
TH2D *hist[30];
THStack *a = new THStack(“a”,“LegoPlot”);

for(Int_t ihist=0; ihist<30; ihist++ ) {
TString hn=“hist_”; hn+=ihist;
hist[ihist] = new TH2D(hn,hn,50,0,50,50,0,50);
hist[ihist]->SetBinContent(2*ihist+1,1,double(ihist));
hist[ihist]->SetFillColor(40);
if(ihist<19) // up to 18 is ok !
a->Add(hist[ihist]);
}
a->Draw();
}

This problem is fixed in the CVS head now. Thanks to have reported this problem.