[ROOT] Plotting feature with ROOT v4.00.06a?

From: daniel cussol (cussol@ccimap.in2p3.fr)
Date: Mon Jun 28 2004 - 12:34:45 MEST


Hello happy rooters,
 I have transfered all my analyses programs under ROOT v4.00.06a under 
RedHat v9. Congratulations for the new version and the new editor. I 
have however a small problem when I try to plot 2D histograms with the 
"col" option in a TPad with the logz option activated, and the color 
palette set with the gStyle->SetPalette(1) command: empty cells are 
always plotted in blue! This was not the case with the 3.10.02 version 
and is quite annoying since a large part of my plotting procedure use 
these options. Could empty cells be white in whatever the status of the 
Logz option on the curreent TPad, as for previous ROOT V3 versions? I 
have joint to this message a small procedure which illustrates the 
present message.
 Friendly

-- 
Daniel CUSSOL

LPC Caen IN2P3/ENSICAEN/Universite de Caen
Boulevard du Marechal Juin
14050 CAEN CEDEX

e-mail : cussol@in2p3.fr
Tel    : +33-(0)2-31-45-29-73
FAX    : +33-(0)2-31-45-25-49



void TestDrawZcol(Double_t zmax=1.,Double_t k=0.02)
{
TH2F *h2=new TH2F("TestDrawZcol","Test Draw Zcol",50,-10,10,50,-10,10);
gStyle->SetPalette(1);
gPad->SetOptLogz(kTRUE);
Double_t zmin=zmax;
for(Int_t i=1;i<=50;i++)
 {
 Double_t x=h2->GetXaxis()->GetBinCenter(i);
 for(Int_t j=1;j<=50;j++)
  {
  Double_t y=h2->GetYaxis()->GetBinCenter(j);
  Double_t drel=TMath::Abs((x*x+y*y)-9.);
  Double_t res=zmax-k*drel;
  Double_t theta=TMath::ACos(x/TMath::Sqrt(x*x+y*y));
  if(y < 0) theta=TMath::TwoPi()-theta;
  res*=0.02*(1+TMath::Cos(theta*3.));
  if(res > 0) 
   {
   h2->Fill(x,y,res);
   if(res < zmin) zmin=res;
   }
  }
 }
h2->SetMinimum(zmin);
cout << "Minimum Weight: " << zmin << endl;
h2->Draw("zcol");
}



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