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
Describe the bug 🐞
I tried to plot an ODESolution with legends, following the code example found here.
Expected behavior
I expected the axislegend(a)-line to add a generic legend to the plot. Instead, I got the following error-message:
ERROR: There are no plots with labels in the given axis that can be put in the legend. Supply labels to plotting functions like `plot(args...; label = "My label")`
Minimal Reproducible Example 👇
using DifferentialEquations, Makie
using CairoMakie
functionodefun(du, u, p, t)
du[1] = u[2]
du[2] =-u[1]
end
u0 =rand(2)
tspan = (0., 10.)
prob =ODEProblem(odefun, u0, tspan)
sol =solve(prob)
f, a, p =plot(sol)
axislegend(a)
f
Error & Stacktrace ⚠️
ERROR: There are no plots with labels in the given axis that can be put in the legend. Supply labels to plotting functions like `plot(args...; label = "My label")`
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] Legend(fig_or_scene::Figure, axis::Axis, title::Nothing; merge::Bool, unique::Bool, kwargs::@Kwargs{…})
@ Makie ~/.julia/packages/Makie/XQfuO/src/makielayout/blocks/legend.jl:658
[3] Legend
@ ~/.julia/packages/Makie/XQfuO/src/makielayout/blocks/legend.jl:656 [inlined]
[4] #axislegend#2282
@ ~/.julia/packages/Makie/XQfuO/src/makielayout/blocks/legend.jl:753 [inlined]
[5] axislegend
@ ~/.julia/packages/Makie/XQfuO/src/makielayout/blocks/legend.jl:752 [inlined]
[6] axislegend(ax::Axis)
@ Makie ~/.julia/packages/Makie/XQfuO/src/makielayout/blocks/legend.jl:727
[7] top-level scope
@ ~/Documents/Code projects/MSSPlayground/src/test.jl:19
Some type information was truncated. Use `show(err)` to see complete types.
Environment (please complete the following information):
Looks like this is caused by a change in Makie - PlotList plots which we use here are no longer decomposed and splatted into the scene. Will look into a fix on the Makie end - thanks for the report!
Describe the bug 🐞
I tried to plot an
ODESolution
with legends, following the code example found here.Expected behavior
I expected the
axislegend(a)
-line to add a generic legend to the plot. Instead, I got the following error-message:Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
The text was updated successfully, but these errors were encountered: