You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the present version of plots, I am hitting this warning which is causing a lot of spam around plots.
At some point, it looks like Plots changed from using NaN segments to using a vector of coordinates [from v1.11] This breaks the assumption here. Under the hood, I believe this was converting the y series into something like [1.0, 1.0, NaN, 1.0, 1.0, NaN, 1.0, 1.0, NaN]...etc. Now however, we want to do [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
This looks like it will fix it [tested locally, will add into an MR at some point]
@recipefunctionf(xs::AbstractVector{<:AbstractInterval{T,L,R}}, ys) where {T, L <:Bounded, R <:Bounded}
new_xs = Vector{T}[]
new_ys = Vector{Any}[]
markers = Symbol[]
for (x, y) inzip(xs, ys)
# To cause line to not be connected, need to divide individually separated segments into separate vectorsappend!(new_xs, [[first(x), last(x)]])
append!(new_ys, [[y, y]])
endappend!(markers, interval_markers(first(xs)))
# Work around GR bug that shows :none as a marker#TODO: remove once https://github.com/jheinen/GR.jl/issues/295 is fixed
markeralpha := [x ==:none?0:1for x in markers]
markershape := markers
seriestype :=:path# always a path, even in a scatter plot
new_xs, new_ys
end
Can make this into an MR, but this would break older versions of Plots. Can keep both. Looks like behaviour changes slightly too, as now it iterates through the colour map (each line is a different colour).
I've came across this issue too, and wonder why a vector of intervals is plotted as a single path. Currently the plotting of Intervals is also broken for vectors of Intervals where the bounds are mixed (e.g. [Interval{Open,Closed}(1,2),Interval{Closed,Closed}(2,3)] is excluded from the signature. For this to work the where clause needs to be moved.
I'm running into this too. Wondering to what extent it would make sense to do something like this, i.e. define the recipe for a single interval & y value?
Then composition over multiple intervals can be achieved with multiple calls to plot!.
@recipefunctionf(x::AbstractInterval{T,L,R}, y::Real) where {T,L<:Bounded,R<:Bounded}
markers =interval_markers(x)
#TODO: remove once https://github.com/jheinen/GR.jl/issues/295 is fixed
markeralpha := [x ==:none?0:1for x in markers]
markershape := markers
seriestype :=:path# always a path, even in a scatter plotreturn [first(x), last(x)], [y, y]
end
In the present version of plots, I am hitting this warning which is causing a lot of spam around plots.
At some point, it looks like Plots changed from using
NaN
segments to using a vector of coordinates [from v1.11] This breaks the assumption here. Under the hood, I believe this was converting they
series into something like[1.0, 1.0, NaN, 1.0, 1.0, NaN, 1.0, 1.0, NaN]
...etc. Now however, we want to do[[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
This looks like it will fix it [tested locally, will add into an MR at some point]
Can make this into an MR, but this would break older versions of Plots. Can keep both. Looks like behaviour changes slightly too, as now it iterates through the colour map (each line is a different colour).
Related: #134
The text was updated successfully, but these errors were encountered: