2D Scatter plot in log scale does not work?

Hi All,

I’m trying to get a scatter plot using a tree. I have made a plot in linear scale and seems to be OK (Canvas c1).
Later, I have created a new canvas, set log-log and the plot makes no sense!! What am I doing wrong?
I have tried both with and without the last line (c2->Update()) not to avail.

Thanks in advance for your help.
Pablo

BTW: I’m using 3.10/02 in Linux RH 9.0

The script follows

{gROOT->Reset();
// This file has two Trees named ‘mr’ and ‘dn’. I’m interested in
// variables HVEM and LVEM

TFile *CSU_Duets_V3 = TFile::Open(“CSU_Duets_V3.0_0312.root”);

TCanvas *c1 = new TCanvas(“c1”,“linear”,1,1,400,400);
mr->SetMarkerStyle(20);
c1->DrawFrame(1,1,2000,2000);
mr->Draw(“LVEM:HVEM”,"",“same”);

TCanvas *c2 = new TCanvas(“c2”,“log”,1,500,400,400);
c2->DrawFrame(1,1,2000,2000);
c2->SetLogx();
c2->SetLogy();
mr->Draw(“LVEM:HVEM”,"",“same”);
//c2->Update();
}
CSU_Duets_031229_0312.root (63.2 KB)

Hi Pablo,

For some reason (not yet completly clear to me) the following way works:

{
   gROOT->Reset();
   // This file has two Trees named 'mr' and 'dn'. I'm interested in
   // variables HVEM and LVEM

   TFile *CSU_Duets_V3 = TFile::Open("CSU_Duets_031229_0312.root");

   TCanvas *c1 = new TCanvas("c1","linear",1,1,400,400);
   mr->SetMarkerStyle(20);
   c1->DrawFrame(1,1,2000,2000);
   mr->Draw("LVEM:HVEM","","same");

   TCanvas *c2 = new TCanvas("c2","log",1,500,400,400);
   c2->DrawFrame(1,1,2000,2000);
   mr->Draw("LVEM:HVEM","","same");   
   c2->SetLogx();
   c2->SetLogy();
}

ie, set the log scales after the TTree drawing

Thanks for reporting this problem with your combination of calls.
It is now fixed in the CVS version.
The fix will be included in the binary files for version 4.00/04 this week.

Rene

Thanks for the idea!
I’ll get the new version as soon as is available.