I have various datasets, each potentially spanning multiple days. The datasets have unknown contents at time of writing (as they come from logfiles), and the range of data to display is down to my users at any given time.
I would like an X axis similar to that shown below. Time ticks are displayed as HH:MM, but change to the date to mark the start of a new day.
(© Advanced Software Engineering Limited — taken from ChartDirector documentation)
I don't want to show DD MM HH:MM on every tick, because that's a waste of space!
I've played around with setting HH:MM for the auto ticks, then manually adding extra DD MM ticks at each midnight (with a leading \n in the label). I also tried to make use of the minor ticks:
set format x "%d %b"
set xtics <start>,2592000,<end>
set format x "%H:%M"
set mxtics default
… but this left me with no ticks at all. Besides, ideally I'd like to just "ask" GnuPlot to do this for me, rather than hardcoding ticks, so that auto-scaling can show/hide ticks depending on how much space is available. (However, as I am generating the GnuPlot script from a C++ program that knows the start/end dates of the data being plotted, I do have the ability to generate set xtics commands with specific dates/times in them, if necessary.)
ChartDirector achieves this by allowing us to set "multi-labels", basically ticks whose label format depends on a condition, like "is this the first label of a new day?".
Is there anything similar in GnuPlot? Solution should be compatible with GnuPlot 4.4.