THStack Draw("padsE1")does not work

Hi Rooters,

I am using 5.26/00a on Ubuntu 9.10, 64 bit.
Using the att macro indicates that option “E” (errors) does not work
together with option “pads”. Also markers are not drawn.

Cheers
Otto
stack.C (830 Bytes)

Hi Otto,
I am looking at it.
Olivier

Solution:

{
   THStack *hs = new THStack("hs","Stacked 1D histograms");

   TH1F *h1st = new TH1F("h1st","test hstack",100,-4,4);
   h1st->FillRandom("gaus",20000);
   h1st->SetMarkerStyle(7);
   h1st->SetMarkerColor(kRed);
   hs->Add(h1st,"e1");

   TH1F *h2st = new TH1F("h2st","test hstack",100,-4,4);
   h2st->FillRandom("gaus",15000);
   h2st->SetMarkerStyle(7);
   h2st->SetMarkerColor(kBlue);
   hs->Add(h2st,"e1");

   TCanvas *cst = new TCanvas("cst","stacked hists",10,10,700,700);
   cst->Divide(1,3);
   cst->cd(1); hs->Draw("e1");
   cst->cd(2); hs->Draw("e1nostack");
   cst->cd(3); hs->Draw("pads");
}

Hi Olivier,
thanks for the answer / solution.

Its anyway a bit asymmetric:
With options “stack” or “nostack” hists are drawn with option passed to
THStack::Draw(option)
whereas with “pads” they are drawn with options passed when they
are added to THStack.
In my HistPresent I allow the user to draw / paint a ready made stack
with any option, so in case of “pads” I have to adjust the option for
all members of the stack separately.

Cheers
Otto

So you would like that is SetDrawOption is called it overwrites the option set in “Add” … ?

For me it would sound more consistent, but it might influence
other peoples macros which assume the current behavior.
May be you talk to somebody else
Otto