Date Axis in TProfileX

Hi all,

I have X axis in a graph on which lumi sections are plotted (1 lumi section = 23.36 sec). I have to convert this X axis into day/month. There are 300000 lumi sections and these need to be plotted over a period from 26 April to 24 October. Can somebody please help me do it?

Best regards,
Ashish

It looks like you are looking for time on the axis. We have several examples in the reference guide. See for instance:
https://root.cern/doc/v626/timeonaxis_8C.html

Good morning,

Actually I am able to set date [Day/month] but the problem that I am facing right now is 300000 lumi sections are considered as 300000 seconds by default and my plot is not showing beyond four days.
Do you know how to fix it?

I used the following to set date axis.

TDatime da(2018,04,26,00,00,00);
int X0 = da.Convert();
gStyle->SetTimeOffset(X0);

TDatime da1(2018,04,26,00,00,00);
int X1 = da1.Convert()-X0;

TDatime da2(2018,10,24,00,00,00);
int X2 = da2.Convert(1)-X0;

Cheers,
Ashish

Can you post a complete example reproducing the problem ?

|394px;x267px;

I have this graph. I need to set X axis that starts from 26/04/2018 and ends on 24/10/2018 maybe using TGaxis?

It seems you are not using the time axis provided by ROOT as I suggested. That’s right ?
You do not need TGaxis, just proceed like in the timeonaxis*.C examples I pointed before.

If you do not want to use time axis but want to change the X axis labels you can use the
ChangeLabel method.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.