Skip to content

Colour scale changes when outliers are present #1308

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
alanocallaghan opened this issue Jul 19, 2018 · 0 comments
Closed

Colour scale changes when outliers are present #1308

alanocallaghan opened this issue Jul 19, 2018 · 0 comments
Labels

Comments

@alanocallaghan
Copy link
Contributor

I've noticed this issue recently. Outliers in the variable mapped to colour cause the scale to alter in an (user) uncontrollable fashion. It usually results in a color scale that is not useful.

library(plotly)
library(viridis)

f <- rnorm(100)
plot_ly(x=f, y=f, color=f, colors=viridis(100))
## Looks fine...

screenshot from 2018-07-19 16-02-15

f[[5]] <- 1e2
plot_ly(x=f, y=f, color=f, colors=viridis(100))
## Color scale has changed due to one outlier

screenshot from 2018-07-19 16-03-21

This seems to be a plotly R issue - I had a quick check using codepen:

No outliers: https://codepen.io/alanoc/pen/GBNoRm
Outliers: https://codepen.io/alanoc/pen/VBmeLK

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

No branches or pull requests

2 participants