title: Plotly: How to set style and color for the arrows using add_annotations?
body: <p>I want to represent 2D vectors rooted at the origin with plotly in R. Moreover, I want to color the vector based on a categorical variable. The problem is that I can either create the lines color-coded but without the arrow head:</p>
  
  <pre><code>
  library(plotly)
  library(dplyr)
  
  v &lt;- c(1, 1)
  b1 &lt;- c(1, 0)
  b2 &lt;- c(0, 1)
  df &lt;- data.frame(
    x = c(v[1], b1[1], b2[1]),
    y = c(v[2], b1[2], b2[2]),
    is_basis = c(FALSE, TRUE, TRUE)
  )
  df %&gt;% 
    plot_ly(x = ~x, y = ~y, color = ~is_basis) %&gt;%
    add_segments(xend = ~x, yend = ~y, x = 0, y = 0, colors = c("red","black"))
  </code></pre>
  
  <p>Or with the arrow-head but not color-coded:</p>
  
  <pre><code>df %&gt;% 
    plot_ly(x = ~x, y = ~y, color = ~is_basis) %&gt;%
    add_annotations(x = ~x, y = ~y, showarrow = TRUE, text = "", ax = 0, ay = 0,
                    axref = "x", ayref = "y", xref = "x", yref = "y")
  </code></pre>
  
  <p>So, my question is: Can I add an arrow head with add_segments? Or, can I style and color the arrows generated with add_annotations?</p>