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

ggplotly does not respect group variable when used with color variable

Open zhengzheli opened this issue 2 years ago • 0 comments


Hi, The following is affecting my ability to use ggplotly: When color = Species and group = 1, all dots should be connected, irrespective of species, but ggplotly does not respect the group variable and it is as if I only wrote color = Species. Thanks for your work on this great library! If there is a workaround please let me know.

With ggplotly: image

only ggplot: image

ggplotly(ggplot(data = iris) +
  geom_line(mapping = aes(Sepal.Length, Sepal.Width, color = Species, group = 1)) +
  geom_point(mapping = aes(Sepal.Length, Sepal.Width, color = Species, group = 1)))

zhengzheli avatar May 03 '23 13:05 zhengzheli