Skip to content

boxplot: specification color bounding box  #1292

Closed
@lcougnaud

Description

@lcougnaud

I would like to set the color of the line bounding the box of a boxplot.
It is mentioned in the documentation that the 'color' parameter via the 'line' parameter is available for this purpose.
However, it seems that this color overwrites the filling color of the boxplot when used in combination with the 'color' parameter:

data <- data.frame(x = rep(c("A", "B"), each = 5), y = rnorm(10))
plot_ly(data) %>% 
add_boxplot(x = ~x, y = ~y, color = ~x, colors = c('A' = "blue", 'B' = "red")

newplot

data <- data.frame(x = rep(c("A", "B"), each = 5), y = rnorm(10))
plot_ly(data) %>% 
add_boxplot(x = ~x, y = ~y, color = ~x, colors = c('A' = "blue", 'B' = "red"), line = list(color = "black"))

newplot 1
Is there an alternative specification to obtain colored boxplot based on a variable, with line set to a fixed color?
Thanks in advance

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