Forcing time axis ticks to once per week?

Dear ROOT experts,

I would appreciate your help with the following question. For a plot vs. time (so time on the x-axis) I’d like to have:

  • Major tick marks for the first day of each month
  • Minor tick marks for each week.
  • Tick labels only for the major ticks.

When ROOT itself decides on where to put the ticks and labels the behavior varies depending (of course) on the time span of the x-axis. I understand the above is a slightly unorthodox way of doing things, from the point of view of axis labeling. I’m curious if anyone knows of a trick I can play to achieve this effect?

I have attached a little macro that creates a simple histogram with a horizontal time axis as a possible starting point for an example.

Best regards,
Jeroen
test_time_axis.C (868 Bytes)

You can change the number of divisions assuming each month as 4 weeks and the same numbers of days. But as it is not true that will not fly I am afraid:

hTest->GetXaxis()->SetNdivisions(-406);

I guess what you want to do cannot be achieve in a simple way