time_t script_time; script_time = time(0); script_time = 3600*(int)(script_time/3600); gStyle->SetTimeOffset(script_time); TCanvas *ct = new TCanvas("ct","Time on axis",10,10,700,900); ct->Divide(1,3); int i; gStyle->SetTitleH(0.08); float noise; TH1F *ht = new TH1F("ht","Love at first sight",3000,0.,2000.); for (i=1;i<3000;i++) { noise = gRandom->Gaus(0,120); if (i>700) { noise += 1000*sin((i-700)*6.28/30)*exp((double)(700-i)/300); } ht->SetBinContent(i,noise); } ct->cd(1); ht->SetLineColor(2); ht->GetXaxis()->SetLabelSize(0.05); ht->Draw(); ht->GetXaxis()->SetTimeDisplay(1); float x[100], t[100]; for (i=0;i<100;i++) { x[i] = sin(i*4*3.1415926/50)*exp(-(double)i/20); t[i] = 6000+(double)i/20; } TGraph *gt = new TGraph(100,t,x); gt->SetTitle("Politics"); ct->cd(2); gt->SetLineColor(5); gt->SetLineWidth(2); gt->Draw("AL"); gt->GetXaxis()->SetLabelSize(0.05); gt->GetXaxis()->SetTimeDisplay(1); gPad->Modified(); float x2[10], t2[10]; for (i=0;i<10;i++) { x2[i] = gRandom->Gaus(500,100)*i; t2[i] = i*365*86400; } TGraph *gt2 = new TGraph(10,t2,x2); gt2->SetTitle("Number of monkeys on the moon"); ct->cd(3); gt2->SetMarkerColor(4); gt2->SetMarkerStyle(29); gt2->SetMarkerSize(1.3); gt2->Draw("AP"); gt2->GetXaxis()->SetLabelSize(0.05); gt2->GetXaxis()->SetTimeDisplay(1); gt2->GetXaxis()->SetTimeFormat("y. %Y %F2000-01-01 00:00:00"); gPad->Modified(); return ct; %jsroot on gROOT->GetListOfCanvases()->Draw()