Re: [ROOT] drawing histos with null y-errors

From: David d'Enterria (denterria@nevis.columbia.edu)
Date: Sat Feb 14 2004 - 21:41:21 MET


René,

Rene Brun wrote:

> Use option "hist". See documentation of TH1::Draw, THistPainter::Paint

ummh ... is this an "automatic response" message ? of course I can use 
"hist" (see the mail). the docs I'm reading them since 1997...
probably my mail was not clear enough ...
people usually expect doing h->Draw() and get something on the screen 
(i.e. the default option="" of TH1::Draw to be "clever" enough to 
display something) if the histo is not empty. I was asking perhaps for a 
modification of THistPainter::Paint(Option_t *option) to plot, by 
default (i.e. when option=""), the histo with "hist" option when the 
errors are null ...

thanks

>> I want to plot (for graphical purposes only) a histogram which has 
>> been filled manually and has null y-errors. The default drawing 
>> option for histos in this case produces a "blank" output in the 
>> canvas. An example shows the:
>>
>> TH1D* h = new TH1D("h","h",100,0,100);
>> h->FillRandom("pol1",5000);
>> h.Draw(); // no problem here the histo has non-null y-errors
>> for (int i=0;i<h->GetNbinsX()+1;i++){h->SetBinError(i,0.);};
>> h.Draw(); // the histo "disappears"
>> h.Draw("h"); // OK the histo is back there ...
>>
>> Is this is a bug or a feature ? Why doesn't THistPainter::Paint 
>> (Option_t *option) set the default (empty) draw option to "h" in this 
>> case ?
>>
>> Thanks.
>>
>> PS: Using root_v4.00.01.Linux.RH7.3.gcc296 binaries (same feature in
>> root_v3.10.01.Linux.RH7.3.gcc296)
>
-- 
 David d'Enterria                         Nevis Labs, Columbia University
 http://www.nevis.columbia.edu/~denterria      538 W. 120th St., NY 10027
 mailto:denterria@nevis.columbia.edu        tel/fax: +1 212 854 5199/3379
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 PHENIX Collaboration                             Brookhaven National Lab
 http://www.phenix.bnl.gov/~enterria           Bldg 510C, Upton, NY 11973
 mailto:denterri@bnl.gov                    tel/fax: +1 631 344 7053/3253
 -------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET