MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.42k stars 313 forks source link

meshscatter does not produce an element in the legend #4066

Open gdkrmr opened 3 months ago

gdkrmr commented 3 months ago

I noted that meshscatter does not produce a symbol in the legend and trying to create a MWE I got the following:

julia> fig = Figure()

julia> ax = Axis3(fig[1, 1])
Axis3()

julia> meshscatter!(ax, 1, 1, 1, label = "hello")
MeshScatter{Tuple{Vector{Point{3, Float64}}}}

julia> Legend(fig[1, 2], ax)
ERROR: `legendelements` returned an empty list for content element of type MeshScatter{Tuple{Vector{Point{3, Float64}}}}. That could mean that neither this object nor any possible child objects had a method for `legendelements` defined that returned a non-empty result.
Stacktrace:
asinghvi17 commented 3 months ago

The fix for this would be twofold:

  1. A MeshscatterElement legend element (or maybe a more general MeshElement)
  2. An implementation of legendelements that returns a MeshscatterElement.