Skip to content

unneeded warning about colours #2289

@ThierryO

Description

@ThierryO

Running the code below return the plot with a warning about the number of colours.
This is not needed as I provided the full colour palette.

library(plotly)
colours <- c(
  "#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red",
  "#7F0000"
)
x <- data.frame(
  id = factor(colours)
)
plot_ly(x) |>
  add_markers(x = ~id, y = ~id, color = ~id, marker = list(color = colours))
Warning messages:
1: In RColorBrewer::brewer.pal(N, "Set2") :
  n too large, allowed maximum for palette Set2 is 8
Returning the palette you asked for with that many colors

2: In RColorBrewer::brewer.pal(N, "Set2") :
  n too large, allowed maximum for palette Set2 is 8
Returning the palette you asked for with that many colors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions