Re: Problems with TH2F->Draw("col")

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Jan 08 1999 - 15:56:32 MET


Thomi Walter wrote:
> 
> Hi everybody!
> 
> On my system, the option "col" doesn't function at all.
> (linux, libc5, root 2.0.13)
> 
> Here is a interactive root-session as a example:
> 
> root [0] TH2F myHH("Tt1", "TT2", 8, 0., 32., 32, 0., 16.);
> root [1] myHH->SetBinContent(34,10.);
> // the following options are functioning correctly!
> root [2] myHH->Draw("lego");
> root [2] myHH->Draw("lego1");
> root [2] myHH->Draw("lego2");
> root [2] myHH->Draw("lego3");
> root [2] myHH->Draw("surf");
> root [2] myHH->Draw("surf1");
> root [2] myHH->Draw("surf2");
> root [2] myHH->Draw("surf3");
> root [2] myHH->Draw("surf4");
> 
> // with the following options only a empty hisogram is drawn!
> root [3] myHH->Draw("col");
> root [3] myHH->Draw("cont");
> root [3] myHH->Draw("cont1");
> 
> What am I doing wrong?
> 
> Many thanks in advance!
> 
> Thomas Walter


When you use TH1::SetBinContent, the number of entries in the histogram
is not changed (only TH1::Fill increments).
The 3-d Paint functions do not check if the number of entries = 0,
but this check is in the 2-d Paint functions.
If you add the following statement after myHH->SetBinContent(34,10);
  myHH->SetEntries(1);
then the 2-d drawing will work as expected.
I will modify the code to remove the check on the number of entries
in the 2-d drawing functions.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:27 MET