Configure sub-second display for a time axis

I’d need to create a time axis with sub-second divisions. What I do now is:

xAxis->SetTimeFormat("#left|#splitline{%y/%m/%d}{#splitline{%H:%M}{:%S}}#right|%F1970-01-01 00:00:00");

This format produces too many sub-second digits in the axis:



making it difficult to read. Is there a way to tell the axis to display only the first digit of the sub-second part? Thanks.

Can you provide a small running script with a such axis ?

The problem happens when zooming an axis whose limits are very big numbers (like UTC time stamps for the current period). This script:

TH1F h("h", "histo", 10, 1426895999.913375, 1426896016.382062)
TAxis *xAxis = h.GetXaxis();
xAxis->SetTimeDisplay(1);
xAxis->SetTimeFormat("#left|#splitline{%y/%m/%d}{#splitline{%H:%M}{:%S}}#right|%F1970-01-01 00:00:00");
xAxis->SetTimeOffset(0, "GMT");
xAxis->SetLabelOffset(0.020);
xAxis->SetLabelSize(0.03);
xAxis->SetTimeDisplay(kTRUE)
xAxis->SetRangeUser(1426895999.913375, 1426895999.914)
h.Draw()

produce this on my machine:

thanks. I get the same on y Mac. I’ll have a look.

It looks like the second precision is fixed. See line 1965 here:
root.cern.ch/doc/master/TGaxis_8cxx_source.html

OK, thank you. I’ll try to play with the limits of the axis to see if rounded limits improve the situation.