-
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
Disappointing Behavior with colors and Guide.manual_color_key #940
Comments
Can you post a minimal code example for us to reproduce? |
Here it is:
Using
Now I attempt to use
I suggest that |
How about: cscale = Scale.color_discrete_manual(colorant"red", colorant"green", colorant"blue")
p = plot(iris, x = :SepalWidth, y = :SepalLength, color = :Species, Geom.point,
cscale, Guide.colorkey("Iris")
) See Guide.manual_color_key for an example of the sort of plot its designed for. |
That's one alternative. I needed to change the label values as well to a string that it is not supported for column names in data frames so defining the |
So the issue here seems to be what to do about difficult factor/level/label names in d = Dict{String,String}("setosa"=>"p=0.1","versicolor"=>"p=0.2", "virginica"=>"p=0.3")
# Add a new variable to the dataframe:
iris[:g] = map(x -> d[x], iris[:Species])
p = plot(iris, x = :SepalWidth, y = :SepalLength, color = :g, Geom.point,
cscale, Guide.colorkey("Iris")
) |
I like that approach as it is a good workaround and in many cases preferred to creating the different layers. However, I still think it is worthy to address the compatibility issue between |
Yes, I agree with @Nosferican. It would be great if |
Any updates on this front? An alternative would be to have the On a potentially related aspect, for Functions and Expressions the default |
Not yet. Another possible option here is to give each p = plot(
layer([sin, cos], 0, 25, Theme(key_position=:none))
) |
Yes for Functions and Expressions, currently the function names are fixed here. |
With p= plot(iris, Geom.point,
x = :SepalWidth, y = :SepalLength, color = :Species,
Guide.colorkey(title="Not Species", labels=["setosa?", "versicolor?", "virginica?"])
) So the original issue here doesn't seem to apply anymore. Also there are reasons that a user might want to actually have 2 keys: |
Guide.manual_color_key renders an additional legend instead of replacing the default one from colors.

The text was updated successfully, but these errors were encountered: