I am trying to specify the color of the points in my scatter plot. I would like to be able to specify a different color and alpha for each point.
The following snippet gives me the error "Error in grDevices::col2rgb(colors, alpha = alpha) : invalid color name 'rgba(105,100,30,.6)'"
I am quite stuck on this, any help is appreciated.
Thanks!
library(plotly)
library(ggplot2)
library(igraph)
tree <- make_tree(127,2)
tree_layout <- layout_as_tree(tree)
tree_layout_df <- as.data.frame(tree_layout)
Xn <- tree_layout_df[,1]
Yn <- tree_layout_df[,2]
marker_color <- rep('rgba(105,100,30,.6)',127)
reg_tree_plot <- plot_ly() %>%
add_trace(x=~Xn, y=~Yn, type='scatter', mode='markers',color=~Xn,
colors=marker_color)