title: R Plotly: Split legend: symbols and color
body: <p>I have some data and two categories for each datapoint "symbol" and "name". I am plotting the data and mapping the categories with different symbols and colors as seen below. </p>
  
  <pre><code>data &lt;- data.frame(
          x= c(1,2,3,4,5,6,7,8),
          y = c(10,11,10,12,11,9,8,13), 
          symbol = c("invalid", "valid", "invalid",
                     "valid", "valid", "valid","valid", "valid"),
          name = c("A", "B", "B", "A", "A", "A", "B", "B"))
  
  
  plot_ly(data) %&gt;%
  add_markers(y = ~y,  x = ~x,  symbol = ~symbol, color = ~name,
              symbols = c(4, 27),
              mode = 'markers',
              #split = ~name,
              colors = c("red", "navy"))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Zn7U8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Zn7U8.png" alt="enter image description here"></a></p>
  
  <p>The legend is very clumsy. </p>
  
  <p>I want to merge the two legend entries with the cross and have a neutral color for the cross in the legend, like this:</p>
  
  <p><a href="https://i.stack.imgur.com/1rXXa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1rXXa.png" alt="enter image description here"></a></p>
  
  <p>I tried using the <code>split</code> parameter, but that did not help.</p>