Is it possible to create arrows in plotly? I'm trying to plot directions, and the workaround I did was just to plot a straight line, which is just not the same as an arrow.
Basically, I have a data frame and want to create, for every set of points in the data frame, an arrow that goes from the origin axis (0,0) to the point in the data frame.
library(plotly)
# Create a dataframe with a named point
df <- data.frame(x = 2, y = 2)
row.names(df) <- "individual A"
plot_ly() %>%
add_annotations(x = df$x, y = df$y, text = row.names(df))
I think it should have something to do with add_annotations
, as it creates arrows pretty easily, but I don't know how to make them start at the origin.