TGraph with time axis

Hi,

I would like to make a TGraph where the x axis is in time and the units are in weeks i.e. I will do this

gr->SetPoint(gr->GetN(),x,y);

and x = 0 means week 0, x = 1 means week 1, x = 2 means week 2, etc.

I have tried to use

gr->GetXaxis()->SetTimeDisplay(1);

and looked at the documentation in the root manual, but I can’t figure out how to get the units of the x axis to be weeks. Does anyone know?

Thanks.

it is not possible to display in weeks.
but seems to me a normal axis should do it ?

I want to have bins corresponding to one week. I want the x-axis not to be labeled 1, 2, 3, 4, etc. but 1 July 2013, 8 July 2013, 15 July 2013, etc.

Such labelling based on weeks does not exist. The only solution I can think of is to adjust to number of divisions to make in match… not sure it will work.

There is a problem with defining weeks anyways.

Is it that January 01 is the first day of the first week, and new weeks start every seven days from that? Then in later months the first won’t be the first day of a week anymore.

Is it by-week-reset-each-month where the first of the month is a new week, then every seven days?

Is it just that Mondays signal a new week, and you have weird partial weeks at the beginning/end of the year?

Or is it an ISO week?
https://en.wikipedia.org/wiki/ISO_week_date#Calculating_the_week_number_of_a_given_date

Depending on your answer, it may be trivial using some
http://root.cern.ch/root/html/TDatime.html methods.

Jean-François