Deleting legends fails #2657
-
Having the same problem as reported here, i.e. wanting to update plotted lines including the legend, I ran into the issue that a using GLMakie
f = Figure()
ax1 = f[1,1] = Axis(f)
ax2 = f[1,2] = Axis(f)
p1 = lines!(ax1, rand(10), label = "foo")
p2 = lines!(ax2, rand(10), label = "bar")
function add_a_legend!(ax) axislegend(ax); return nothing end
add_a_legend!(ax1)
add_a_legend!(ax2)
empty!(ax1)
[delete!(leg) for leg in f.content if leg isa Legend] I get
from Makie.jl/src/makielayout/blocks.jl Line 508 in b1b9ef2 This is with Makie 0.19.2, Julia 1.8.5. Am I doing something wrong, or is this a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Probably just a bug, because deletion is currently untested. It would be a good project to start and make these methods more correct and robust, and fix that behavior via tests so that it doesn't break at the next moment again. This hasn't been the priority historically, because we had much more to do with creating things before we wanted to delete them :) |
Beta Was this translation helpful? Give feedback.
Probably just a bug, because deletion is currently untested. It would be a good project to start and make these methods more correct and robust, and fix that behavior via tests so that it doesn't break at the next moment again. This hasn't been the priority historically, because we had much more to do with creating things before we wanted to delete them :)