plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

unneeded warning about colours

Open ThierryO opened this issue 2 years ago • 0 comments

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

ThierryO avatar Aug 30 '23 13:08 ThierryO