Makie how to conditionaly hide a legend entry in `axislegend`

I have a function that makes the plot on the left:

it achieve this via the standard scatter!(xxx; label = "something") infrastructure, after which I call axislegend.

I want to use the same plot on the right. On top of it I want to plot other elements with their legend entries. I don’t want to repeat the previous legend entries.

I thought doing the conditional scatter!(xxx; label = add_legend ? "something" : "") would solve things. but it doesn't because the legend entry is there.

I ask therefore: what is the default keyword argument value for label? So that I can programmatically / conditionally hide some legend entries in axislegend?

Not sure I fully understood what you want to accomplish here, but is this what you’re looking for?

using GLMakie

xs = range(0, 2π; length = 501)
y1s = sin.(xs)
y2s = cos.(xs)

fig = Figure()
ax = Axis(fig[1,1])
lines!(ax, xs, y1s; label = "Base data")
add_legend = false 
lines!(ax, xs, y2s; label = add_legend ? "Additional data" : nothing)
axislegend(ax)
fig

Yes thank you! I guess nothing is the obvious default keyword I should have tried first!