Skip to content

Colour scale changes when outliers are present #1308

Closed
@alanocallaghan

Description

@alanocallaghan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions