-
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
Manual continuous color legend? #1253
Comments
I would do the above plot like this: x, y = cumsum(randn(n)), cumsum(randn(n))
D = DataFrame(x1=x[1:end-1], y1=y[1:end-1], x2=x[2:end], y2=y[2:end], colv=1:n-1)
palettef(c::Float64) = get(ColorSchemes.viridis, c)
p = plot(D, x=:x1, y=:y1, xend=:x2, yend=:y2,
color = :colv, Geom.segment, Coord.cartesian(aspect_ratio=1.0),
Scale.color_continuous(colormap=palettef, minvalue=0, maxvalue=1000)
) |
That's definitely a better way to make this plot, but my nascent feeling is that it could be useful to have a |
The intent of the grammar of graphics is to "map plot aesthetics to data". I think that for a grammar of graphics package manual keys are a good patch while the package is in development, but in the long-term "manual" keys shouldn't be needed. Scales (with mapping functions) and their respective Guides (with title, labels, position etc) is the intent of gog. |
that's a beautiful plot! would be great to put it in the gallery as there is currently no |
It would be nice to be able to add a manual color key that is continuous.
Guide.manual_color_key
only support discrete color scales.The text was updated successfully, but these errors were encountered: