JuliaStats / TimeSeries.jl

Time series toolkit for Julia
Other
349 stars 69 forks source link

Plot warnings in Documentation #492

Closed SteffenPL closed 3 years ago

SteffenPL commented 3 years ago

In https://juliastats.org/TimeSeries.jl/stable/plotting/ the plots don't have the correct colors anymore and it shows the following warning:

┌ Warning: Indices Base.OneTo(24) of attribute `seriescolor` does not match data indices 1:263.
└ @ Plots ~/.julia/packages/Plots/SVksJ/src/utils.jl:102
┌ Info: Data contains NaNs or missing values, and indices of `seriescolor` vector do not match data indices.
│ If you intend elements of `seriescolor` to apply to individual NaN-separated segements in the data,
│ pass each segment in a separate vector instead, and use a row vector for `seriescolor`. Legend entries
│ may be suppressed by passing an empty label.
│ For example,
└     plot([1:2,1:3], [[4,5],[3,4,5]], label=["y" ""], seriescolor=[1 2])

I suspect that something on the Plots.jl side changed, since it also poped up suddenly in my own code.

SteffenPL commented 3 years ago

Seems related to this change: https://github.com/JuliaPlots/Plots.jl/pull/3320

iblislin commented 3 years ago

Hi @SteffenPL, thanks for the bug report. Could you try the PR #493 out?

VivaldoMendes commented 3 years ago

I am using Plots and I have the same problem as @SteffenPL. I have Plots updated and using Julia 1.6.1. I am not using any other package.

I have a function with a two segments, one of which is represented by NaNs. I need this construction because the function is supposed to have a kink. One year ago, I produced a large set of plots with this type of construction and there was no problem at all.

This year, I am getting the error above, I have made it smaller in my REPL by adding a label and a color to the the NaN segment. But the students might get confused by this trick (they are not studying computation). In the end I just keep getting the annoying message:

Warning: Indices Base.OneTo(1) of attribute `linecolor` does not match data indices 1:21.