I have a plot such as barplot(1:3, 2:4, color = [:red, :blue, :red])
and would like to add a legend such that the red => "A"
and blue => "B"
, how could I accomplish that?
jules
2
If you have array-valued colors you currently have to build legends manually, unfortunately.
f, ax, bp = barplot(1:3, 2:4, color = [:red, :blue, :red])
Legend(f[1, 2], [PolyElement(color = :red), PolyElement(color = :blue)], ["A", "B"])
f
1 Like