Draw from TTree with time on the axis


Is it possible to Draw from a TTree to produce a plot with time on the x axis?
I saved the time information in a branch using TDatime.Convert,then read the tree back and used Draw, and then tried to set the time axis range using

TH1F * htemp = (TH1F*)gPad->GetPrimitive(“htemp”);

This didn’t work and I got a nonsensical range on the time axis.
Is there a way to do this? Can you point me to an example?

Also, is t here a way to use day instad of second intervals if all I care about is the date and not the time?



As you did, you should get the histogram and apply the time settings on it.
The X axis should be second (related to the time offset).
All details are here:
root.cern.ch/drupal/content/how- … time-units