A have a colored scatterplot (made with Makie) and would like to make a legend that explains what the colors mean. How should I modify the following example to achieve this? Tried the kwargs suggested by the docs of
legend(), but couldn’t get it to work.
using Makie set1 = rand(Point3f0, 5) set2 = rand(Point3f0, 5) set3 = rand(Point3f0, 5) sc = Scene() scatter!(sc, set1, color=:blue) scatter!(sc, set2, color=:red) scatter!(sc, set3, color=:green) texts = ["scene", "set1", "set2", "set3"] colors = [:black, :blue, :red, :green] sl = legend(sc, texts, color=colors) vbox(sc, sl)