Dear ROOTers
Using the ROOT 5.15.01 and 5.12/00f on Linux (sorry, not the latest one),
I found some strange feature in Scale method of TH1.
Please try the following core on your machine.
void timetest2() {
TDatime sdate(2006, 05, 20, 00, 00, 00);
gStyle->SetTimeOffset(sdate.Convert());
TH1F *h = new TH1F("h", "", 86400, 0, 86400);
for ( Int_t i = 1; i<86400>SetBinContent(i, 1);}
h->GetXaxis()->SetTimeDisplay(1);
h->GetXaxis()->SetTimeFormat("%y/%m/%d/%H:%M");
TCanvas *c = new TCanvas("c", "", 50, 50, 900, 600);
c->Divide(1, 2);
c->cd(1);
gPad->SetGridx();
h->Draw();
c->cd(2);
TH1F *h2 = (TH1F*)h->Clone("h2");
gPad->SetGridx();
h2->Scale(0.5);
h2->Draw();
}
The time axis in h2 is strange, extending to 2006/5/22 instead of 2006/5/21. Both time axis range should be the same.
In the macro, if I comment out h2->Scale(0.5), I can obtain
the correct time axis range in both h and h2.
please give me any idea.
I try the macro on Linux 2.6.18 of Fedora Core 6 with gcc 4.1.1