I was looking into Makie for plotting some time series but could only find an open issue for having dates on one of the axes. The first suggested fix does not work for me (I get an error when calling lines) and the second seems very verbose. Are there any better options? Maybe with AlgebraOfGraphics?
In addition the second fix leads to weird output in a data example here:
The problem boils down to this: If you can plot more things into an existing axis, what happens if you plot into a “date axis”. Should you be able to plot only dates? Should it be like a normal axis just with ticks that look like dates? How should the conversion from dates to numbers work? This is all not worked out yet, which is why we don’t have one polished approach. It’s easier for Plots.jl where you assemble a plot top-down once.
I think maybe Axis should have a notion of a unit / be unit-aware. Axes are already associated to numbers (limits and ticks and such) so I think those numbers having a unit would be pretty natural. So if say Axis's had Unitful units, then plotting into an axis with different units would try to convert and if it can’t convert, would fail. And if you want to plot a bunch of stuff with incompatible units on the same axis, just ustrip them first. (This is easier now that Unitful 1.7 interoperates with Dates).
I like @ericphanson’s idea that the tick machinery could interoperate with dates (and other unitful quantities) via Unitful. I think here handling this is not as bad as the categorical conversion we used to have, because there is a well defined transformation from timestamps to floats.
One problem with timestamp to float is our float32 conversion. That would not work for nanoseconds or microseconds I think, maybe even larger units, if the distances between the numbers are too small relative to the absolute values.