In AoG I’m trying to do draw(;axis=(;xtickformat=dateformat"yyyy-mm"))
. How can I get what I want?
Good question, the thing is that the formatting function is always given numbers, not dates, so these numbers have to be converted to dates first in order for your formatting to work. I’m not sure what AlgebraOfGraphics is converting time data to before plotting it, but you could search in the source for something with DateTime or so and you should find it.
Also maybe @piever could say something about whether AlgebraOfGraphics offers/will offer more settings for date handling, or how it’s implemented.
There is a convenience function datetimeticks
for manual ticks for timeseries, see eg How to plot more ticks in AlgebraOfGraphics or Makie? - #2 by icweaver or Format date axis. The main downside is that you have to select manually on which dates to have a tick
.
You’re right that it would be helpful to have a function to just update the formatting, without changing the tick selection. Unfortunately, at the moment that’s hardcoded here, but there definitely should be an API to customize it. Feel free to open an issue about this, so that it’s easier to keep track.