Not sure about the second legend (I guess in matplotlib this operates directly with legend objects?), but you could simply add two invisible lines to the plot to have the legend entries:
The solution proposed here is quick and elegant, but in my workflow I will be plotting clouds of points (PCA kind of plot)
I care about how two different variables cluster together, so one variable determines the colour and a different variable determines markershape. I work with several datasets, so the amount of colours/shapes I use will vary a lot.
It would be nice to have the option to add a different legend for each of these things (linetype, markershape, markersize, linecolour, markercolour…)
Has there been any update on this since this post was first solved?
Also - is there any backend that is especially good for legend manipulation? I tend to use PlotlyJS because I love the interactivity of the plot, but I find I lack some wanted freedom with my legends in general (e.g. exact position, or number of columns in legend). Any comments appreciated! Thanks