MakieOrg / AlgebraOfGraphics.jl

An algebraic spin on grammar-of-graphics data visualization in Julia. Powered by the Makie.jl plotting ecosystem.
https://aog.makie.org
MIT License
436 stars 44 forks source link

Add legends for analyses #141

Open jtrakk opened 3 years ago

jtrakk commented 3 years ago

I have some Analyses on a plot, such as a linear fit and a smoother, in different colors. I would like it to create a legend that shows what the lines mean.

let N = 1000
(
    data(DataFrame(a=rand(N), b=rand(N)))
    * mapping(:a, :b)
    * (
        visual(Scatter, markersize=2)
        + AlgebraOfGraphics.linear() * visual(color=:teal)
        + AlgebraOfGraphics.smooth(span=0.1) * visual(color=:pink)
    )
)|> draw(resolution=(800,600))
end

image

pkofod commented 1 year ago

Any update on this?