# Dateformat Makie

**URL:** https://discourse.julialang.org/t/dateformat-makie/85381
**Category:** General Usage
**Tags:** algebraofgraphics
**Created:** [August 6, 2022, 5:35am UTC](https://discourse.julialang.org/t/dateformat-makie/85381 "2022-08-06T05:35:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [August 6, 2022, 5:35am UTC](https://discourse.julialang.org/t/dateformat-makie/85381/1 "2022-08-06T05:35:17Z")

</div>

In AoG I’m trying to do `draw(;axis=(;xtickformat=dateformat"yyyy-mm"))` . How can I get what I want?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [August 6, 2022, 9:50am UTC](https://discourse.julialang.org/t/dateformat-makie/85381/2 "2022-08-06T09:50:44Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)
#### Post date: [August 8, 2022, 12:55pm UTC](https://discourse.julialang.org/t/dateformat-makie/85381/3 "2022-08-08T12:55:31Z")

</div>

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](https://discourse.julialang.org/t/how-to-plot-more-ticks-in-algebraofgraphics-or-makie/77261/2) or [Format date axis](https://discourse.julialang.org/t/format-date-axis/68352). 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](https://github.com/JuliaPlots/AlgebraOfGraphics.jl/blob/75e757cbf900d4461d7f6530f74c16dc49398037/src/scales.jl#L184), 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.
