library(plotly)
fig <- plot_ly()
fig <- fig %>% add_markers(
x = 1,
y = 1,
col = "gray"
)
fig <- fig %>% add_markers(
x = 1,
y = 2,
col = "blue"
)
> fig
For some reason, the gray
is showing up as blue, and the blue
is showing up as orange. How do I specify different colors for different data points?
CodePudding user response:
You need to specify the color
in marker
-
library(plotly)
fig <- plot_ly()
fig <- fig %>% add_markers(
x = 1,
y = 1,
marker = list(color = "gray", size = 10)
)
fig <- fig %>% add_markers(
x = 1,
y = 2,
marker = list(color = "blue", size = 10)
)
fig