title: Change Legend Titles in R Plotly
body: <p>I am using the following code to generate a 3D scatter plot with vectors in Plotly - R studio. Currently, the legend labels are displayed as "trace 1, trace 2, etc", but I'd like to change that with my own text. Any idea how to achieve this?</p>
  
  <pre><code>#Define the data from df to be plotted, basically three columns of a data frame
  x = df[,1]
  y = df[,2]
  z = df[,3]
  
  #Scatter and Axis Labels
  p &lt;- plot_ly() %&gt;%
    add_trace(x=x, y=y, z=z,
              type="scatter3d", mode="markers",
              marker = list(color=y, 
                            colorscale = 'Viridis', 
                            opacity = 0.02,showscale = F)) %&gt;% 
    layout(title = "TITLE",
           scene = list(
             xaxis = list(title = "LABEL 1"), 
             yaxis = list(title = "LABEL 2"), 
             zaxis = list(title = "LABEL 3")))
  
  
  #Add Vectors to the Plot  
  for (k in 1:nrow(df_vector)) {
    x &lt;- c(0, df_vector[k,1])
    y &lt;- c(0, df_vector[k,2])
    z &lt;- c(0, df_vector[k,3])
    p &lt;- p %&gt;% add_trace(x=x, y=y, z=z,
                         type="scatter3d", mode="lines",
                         line = list(width=8),
                         opacity = 1)
  }
  </code></pre>