Hi there,
I have a question regarding date formatting when using plot
with gr()
backend.
Two question:
-
Is there a more julian way to format your dates - here: to only show years - then my last line of code?
-
Is there a way to specifically set the xticks, so e.g. only show year 2023, 2024 and 2027 on the xaxis (not the xlims, but the labelling of the xticks).
using Plots
using Dates
using Distributions
dts = today():Year(1):today()+Year(20)
vs = rand(Normal(0,1),size(dts,1))
plot(dts, vs, label="")
plot!(xformatter = x -> Dates.format(Date(Dates.UTD(x)), "yyyy"))
I cannot find anything in the documentation regarding this.
Thanks for your help!