Contours for 2-D histogram with variable bin width

From: Mark Boulay (mgb@owl.phy.queensu.ca)
Date: Tue Feb 23 1999 - 18:06:48 MET


Hello All,
	I'm trying to define a 2-D histogram with variable
bin width, and then draw a contour map, using root 2.21/03.
The following code illustrates how the histogram is created:

{
 Float_t binsx[6]  = { 1e-5,1e-4,1e-3,1e-2,1e-1,1 }; 
 Float_t binsy[6]  = { 1e-5,1e-4,1e-3,1e-2,1e-1,1 };
 TH2F *hist2 = new TH2F("hist2","Variable bin histogram",5,bx,5,by);
 Int j,k;

 for (j=1; j< 6; j++)
   {
     for(k=1; k < 6; k++)
      {
        hist2->SetCellContent(j,k,(Float_t)(j+k));
      }
   }
}

If I then try to draw this histogram with Draw(), only the axies are
drawn.  Scanning the mouse over the pad (with Event Status on) shows 
that the cells have  the proper contents.  If I then use
Draw("cont"), the same axies are again drawn (without contours).  This
time the Event Status shows that all points inside the axies are in 
cell (6,6).  

Thanks in advance for any help,

Mark.

   

=================================================================
=                                                               =
= Mark Boulay                                                   =
= Department of Physics   phone/voice mail: (613) 533-6861      =   
= Queen's University      fax: (613) 533-6813                   =
= Kingston, Ontario       email: mgb@sno.phy.queensu.ca         =             
= Canada, K7L 3N6         Office 121 (c)                        =
=                                                               =
=================================================================



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