-
Notifications
You must be signed in to change notification settings - Fork 7
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
legend improvements #106
Comments
You're right! I didn't realize. But I think I've stumbled on a bug - it doesn't work when the DataFrame column for
You can recreate with using CategoricalArrays
penguins.island = categorical(penguins.island)
ggplot(penguins, @aes(x=bill_length_mm, y=bill_depth_mm, size=island)) + geom_point() Alternatively, we could try to convert those columns to strings when plotting? |
It's strange - I actually convert the Strings to CategoricalVectors under the hood already. Should be an easy fix I think, I'm sure I'm just missing a check somewhere |
This is fixed in 0.8.0! Multiple legends are still a work in progress though |
In the geom_tile example (link: https://tidierorg.github.io/TidierPlots.jl/latest/examples/generated/geoms/geom_tile/), the color legend is missing. How can I add it? |
I'm going to close this as complete - the second bullet does not work even in R ggplot, and seems like a use case we would want to discourage |
I encountered an issue with the following code: ggplot(gfgt, @aes(x = lon, y = lat, z = co2)) +
geom_tile() +
scale_color_discrete(palette = :tab20, name = "co2") +
theme_light()
Attributes with 5 entries:
Axis => Attributes with 13 entries:
backgroundcolor => transparent
bottomspinevisible => false
leftspinevisible => false
rightspinevisible => false
topspinevisible => false
xgridcolor => (:black, 0.07)
xlabelpadding => 3
xminorticksvisible => false
xticksvisible => false
ygridcolor => (:black, 0.07)
ylabelpadding => 3
yminorticksvisible => false
yticksvisible => false
Axis3 => Attributes with 9 entries:
xgridcolor => (:black, 0.07)
xspinesvisible => false
xticksvisible => false
ygridcolor => (:black, 0.07)
yspinesvisible => false
yticksvisible => false
zgridcolor => (:black, 0.07)
zspinesvisible => false
zticksvisible => false
Colorbar => Attributes with 3 entries:
spinewidth => 0
ticklabelpad => 5
ticksvisible => false
Legend => Attributes with 2 entries:
framevisible => false
padding => (0, 0, 0, 0)
textcolor => gray50 When I run this code as-is, it doesn't work as expected (i.e., it doesn't produce the desired plot). However, if I comment out the scale_color_discrete line: ggplot(gfgt, @aes(x = lon, y = lat, z = co2)) +
geom_tile() +
# scale_color_discrete(palette = :tab20, name = "co2") +
theme_light() the plot is generated, but the color legend is missing. Could you please fix the color legend for geom_tile plots? |
Describe how it works in R's
ggplot2
ggplot(diamonds, aes(x=x,y=y,color=color)) + geom_point()
ggplot(diamonds, @aes(x=Depth, y=Price)) + geom_point(@aes(color=Carat)) + geom_point(@aes(color=Table))
size
andcolor
), Example:ggplot(diamonds, aes(x=x,y=y,color=color, size=carat)) + geom_point()
The text was updated successfully, but these errors were encountered: