THStack problem

Hi,

I tried to reproduce the THStack example from the User’s Guide
Ignoring that there is an obvious pointer problem in the example, I can not all reproduce the given image at all!

My right image is identical, but the left one has obviously a wrong x axis, is not stacked and has no colors.

Any help is appreciated.
Andreas

ROOT: 4.00/08
OS: SuSE Linux 9.1

Code:

THStack *hs = new THStack(“hs”,“test stacked histograms”);
//create three 1-d histograms
TH1F *h1 = new TH1F(“h1”,“test hstack”,100,-4,4);
h1->FillRandom(“gaus”,20000);
h1->SetFillColor(kRed);
hs->Add(h1);
TH1F *h2 = new TH1F(“h2”,“test hstack”,100,-4,4);
h2->FillRandom(“gaus”,15000);
h2->SetFillColor(kBlue);
hs->Add(h2);
TH1F *h3 = new TH1F(“h3”,“test hstack”,100,-4,4);
h3->FillRandom(“gaus”,10000);
h3->SetFillColor(kGreen);
hs->Add(h3);

TCanvas *c1 = new TCanvas(“c1”,“stacked hists”,10,10,1000,800);
c1->Divide(2,1);
// in top left pad, draw the stack with defaults
c1->cd(1);
hs->Draw();
// in top right pad, draw the stack in non-stack mode and errors option
c1->cd(2);
hs->Draw(“nostack”);

I do not see a problem with your script. In attachement the picture
obtained on my system.

Rene


Interesting!

Mine looks quite different:

I am using:
Version 4.00/08 29 July 2004

I do not see any problems with 3.05
Is the version 4.01/01 stable enough to use it?
Then I will test this version, too.

Thanks,
Andreas


There are no problems with ROOT 4.01/01

I will use this version.

Ciao,
Andreas