JuliaPlots / StatsPlots.jl

Statistical plotting recipes for Plots.jl
Other
436 stars 88 forks source link

errorline! does not work with Dates x-axis #545

Open dmetivie opened 10 months ago

dmetivie commented 10 months ago

I tried adding erroline! to a plot with Dates as x-axis but it does not work.

using Dates, StatsPlots

x = DateTime(2000):Hour(1):DateTime(2000,1,4)
x_last = x[end-72:end]
y = randn(length(x))
Y = randn(length(x_last), 100)

plot(x, y)
# plot!(x_last, Y[:,1]) # works
errorline!(x_last, Y) # do not work

Just errorline(x_last, Y) works but as soon as another plot is added (or it is added) the result is wrong. plot_51

I tried looking at the code but could not see what is wrong (maybe it is just a Date+Plot issue? But plot!(Date, y) works.