Hi,
I find that the box option fails for 2-D histograms plotted on a log scale
for tiny values (some limit in precision for calculating box size ?).
Here is a variation of the log-scale-tutorial showing in canvas 2 that no
entries are plotted with the box option.
The problem occurs with cint and with aclic, and happens at least as
recently as root v3_03_05c
Cheers,
Ben
#include "TCanvas.h"
#include "TH2.h"
#include "TRandom.h"
#include "TStyle.h"
void loglog()
{
TCanvas *c1 = new TCanvas("c1");
TCanvas *c2 = new TCanvas("c2");
TCanvas *c3 = new TCanvas("c3");
gStyle->SetOptStat(1111111);
c1->SetLogx();
c1->SetLogy();
c2->SetLogx();
c2->SetLogy();
c3->SetLogx();
c3->SetLogy();
// box option works
Axis_t low = 1E-2;
Axis_t hi = 1E0;
TH2F *h1 = new TH2F("h1","h1 range 1",40,low,hi,40,low,hi);
// box option fails
low = 1E-22;
hi = 1E-19;
TH2F *h2 = new TH2F("h2","h2 range 2",40,low,hi,40,low,hi);
for (Int_t i=0;i<1000;i++) {
h1->Fill(fabs(1E-2*gRandom->Landau(5,2)),(fabs(1E-2*gRandom->Landau(5,10))));
h2->Fill(fabs(1E-22*gRandom->Landau(5,10)),(fabs(1E-22*gRandom->Landau(5,10))));
}
c1->cd();
h1->Draw("box");
c2->cd();
// fails
h2->Draw("box");
c3->cd();
// without box option, it works
h2->Draw();
}
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:57 MET