Time axis with TGraph

Hello,

I have the following problem. I want to have a time axis on a TGraph. The x-values are stored as
TTimeStamp timestamp[ndata];
and the y-values as
float data[ndata];
Before, I used run numbers, which could be easily stored as a float as well and I created a TGraph simply like:
TGraph* gdata = new TGraph(ndata,run,data);
But I cannot figure out how to create a TGraph using the time information in the timestamp instead.
Any idea how this can be achieved?

Thanks in advance for your help!

Petra

check these out:

TAxis::SetTimeDisplay
TAxis::SetTimeFormat

Irakli

See:

{
   TDatime da1(2008,02,28,15,52,00);
   TDatime da2(2008,02,28,15,53,00);

   double x[2],y[2];

   y[0] = 1.;
   y[1] = 2.;
   x[0] = da1.Convert();
   x[1] = da2.Convert();

   TGraph mgr(2,x,y);
   mgr.SetMarkerStyle(20);

   mgr.Draw("ap");

   mgr.GetXaxis()->SetTimeDisplay(1);
   mgr.GetXaxis()->SetNdivisions(-503);
   mgr.GetXaxis()->SetTimeFormat("%H:%M:%S");
   mgr.GetXaxis()->SetTimeOffset(0,"gmt");
}

root.cern.ch/drupal/content/how- … time-units