-
Notifications
You must be signed in to change notification settings - Fork 251
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
color2 #1436
base: master
Are you sure you want to change the base?
color2 #1436
Conversation
@tlnagy thoughts? |
Agreed. This might be a pragmatic solution, but associating scales/colorkey with layers seems much cleaner, discoverable, and intuitive. |
It's not a hack. In Gadfly, aesthetics can be transferred between layers. plot(Coord.cartesian(xmin=0, xmax=5),
layer(x=0.5:3.5, y=0.5*rand(4), color=0:3),
layer(x=0.5:3.5, y=rand(4), color=5:8),
layer(x=1:4, y=rand(4), color2=["Group 1"]),
layer(x=1:4, y=rand(4), color2=["Group 2"]),
Theme(point_size=5pt, color2s=[colorant"hotpink", colorant"violet"])
) |
Also, aesthetic |
Codecov Report
@@ Coverage Diff @@
## master #1436 +/- ##
==========================================
- Coverage 90.26% 89.38% -0.89%
==========================================
Files 39 39
Lines 4140 4389 +249
==========================================
+ Hits 3737 3923 +186
- Misses 403 466 +63
Continue to review full report at Codecov.
|
my thumbs up in #373 was not for i didn't realize aes could be tranferred btw layers! seems quite useful. nevertheless, from a user perspective, i think a cleaner API would be to permit sth like this:
don't know how hard that would be to implement, but the technical debt taken on by |
That's an interesting suggestion. It looks like a new plot element i.e. |
NEWS.md
This PR:
color2
.color2
is a second color scale (discrete only, which covers the use cases in Contour plot with all lines in one color #527, Color facetting fails when combined with a contour layer #1098, Exception in apply_scales() when using multiple layers+DataFrame+color keys #1171)Scale.color2_discrete
andGuide.color2key
color2
has been enabled forGeom.point
.color2
may be enabled for other Geoms.Example