Skip to content

Translate ggplot2's color gradients to plotly's colorscale #232

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

Closed
cpsievert opened this issue Jun 15, 2015 · 3 comments
Closed

Translate ggplot2's color gradients to plotly's colorscale #232

cpsievert opened this issue Jun 15, 2015 · 3 comments

Comments

@cpsievert
Copy link
Collaborator

Scatter traces in plotly will now support a colorscale (known as a gradient in ggplot2), so this example:

qplot(data = iris, x = Sepal.Length, y = Petal.Length, color = Petal.Width)

should use a colorscale like this:

@cpsievert
Copy link
Collaborator Author

For future reference, I've been playing with this on #226, and have a working version for plot_ly() which could fairly easily be brought over to ggplotly()

plot_ly(data = iris, x = Sepal.Length, y = Petal.Length, color = Petal.Width, mode = "markers")

(another factor to consider in all this is that discretizing continuous color scales can be perceptually advantageous).

@joshmyzie2
Copy link

Has this been partially implemented? I noticed it is working (really well) for geom_tile(), but not geom_point() or geom_line().

untitled

@cpsievert
Copy link
Collaborator Author

This should be fixed in f1900cc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants