couet
5
{
// Define the lowest histogram limit as 2010, January 10th 00:00
TDatime T1(2010,01,10,00,00,00);
Double_t X1 = T1.Convert();
// Define the lowest histogram limit as 2010, January 10th 05:00
TDatime T2(2010,01,10,05,00,00);
Double_t X2 = T2.Convert();
TH1F * h1 = new TH1F("h1","test",100,X1,X2);
TRandom r;
for (Int_t i=0;i<30000;i++) {
Double_t noise = r.Gaus(0.5*(X1+X2),0.1*(X2-X1));
h1->Fill(noise);
}
h1->GetXaxis()->SetTimeDisplay(1);
h1->GetXaxis()->SetLabelSize(0.03);
h1->GetXaxis()->SetTimeFormat("%H:%M");
h1->GetXaxis()->SetTimeOffset(0, "gmt");
h1->Draw();
}