Is it possible to add legends with Makie recepies?

I have a Makie.@recipe for a custom type. When creating the plot, I also supply labels to the plot elements such as line!. However, when I call Legend on the axis where the plot is, Makie complaints that there are no labels. Is this not possible?

Makie uses get_plots for that, you could overload it Code search results · GitHub

It’s one of those things that’s not really public API but there’s no other solution right now, and it has existed for a long time