Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legends for continuously styled variables #91

Closed
wants to merge 6 commits into from

Conversation

greimel
Copy link
Collaborator

@greimel greimel commented Sep 25, 2020

Here is some refactoring of the legend creation to simplify adding legends for continuously styled variables.

It also includes a proof of concept for markersize. It builds on the Colorbar PR.

I guess the goal here is to find a general solution for continuous styles (linewidth, alpha, what else?)

Screenshot 2020-09-25 at 18 13 16

addresses #83 and (partially) #57

using RDatasets: dataset
using AlgebraOfGraphics, AbstractPlotting, GLMakie
using AlgebraOfGraphics.MakieLayout

mpg = dataset("ggplot2", "mpg")
cols = style(:Displ, :Hwy)
grp = style(color = :Cyl => categorical)
mpg[!,:Group] = mpg.Cyl .> 6
mpg[!,:Color] = 3 .* rand.() .+ 2 .* mpg.Cyl 

aog2 = data(mpg) * style(:Displ, :Hwy, layout_x = :Drv, markersize = :Color,  marker = :Group => categorical, color = :Color) * spec(Scatter)

scene, layout = layoutscene()
 scat = AlgebraOfGraphics.layoutplot!(scene, layout, aog2)

@greimel
Copy link
Collaborator Author

greimel commented May 13, 2021

Implemented in piever/SplitApplyPlot.jl#32

@greimel greimel closed this May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant