-
Notifications
You must be signed in to change notification settings - Fork 250
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
Color facetting fails when combined with a contour layer #1098
Comments
The issue here is that the user is wanting a continuous color scale for theme(x) = style(default_color=parse(Colors.Colorant,x))
g = [:one, :two]
Da = [DataFrame(x=rand(20), y=rand(20), v=g[i]) for i in 1:2]
discrete_colors = ["deepskyblue", "lightgreen"]
p = plot(
layer(x = linspace(0, 1, 100), y = linspace(0, 1, 100), z = (x,y) -> x + y, Geom.contour),
layer(Da[1], x = :x, y = :y, theme(discrete_colors[1]), Geom.point),
layer(Da[2], x = :x, y = :y, theme(discrete_colors[2]), Geom.point),
Coord.cartesian(fixed=true)
) But, if you want to map Db = vcat([DataFrame(x=rand(20), y=rand(20), v=i) for i in [0.5,1.5]]...)
p = plot(
layer(x = linspace(0, 1, 100), y = linspace(0, 1, 100), z = (x,y) -> x + y, Geom.contour),
layer(Db, x=:x, y=:y, color=:v, Geom.point),
Scale.color_continuous(minvalue=0.0, maxvalue=2.0),
Coord.cartesian(fixed=true)
) |
Ah, I didn't realize that this is a clash of scales. I'll figure out something to work around that based on you examples. Thanks! |
I was trying to plot two traces of points over a function contour:
But doing so results in an error, which seems to have to do with the
color
argument:The following, leaving out the contour plot or the
color
specification, both work without problems:I use version 0.6.4.
The text was updated successfully, but these errors were encountered: