In R plotly subplot graph, how to show only one legend? : <p>I have a basic subplot with two graphs, both have a legend by default, but I want to see only one of them.</p>

<p>I tried this :</p>

<pre><code>require(plotly)
p1 &lt;- plot_ly(data=iris,x=~Sepal.Length,y=~Sepal.Width,split=~Species) %&gt;% layout(showlegend = FALSE)
p2 &lt;-  plot_ly(data=iris,x=~Sepal.Length,y=~Sepal.Width,split=~Species) %&gt;% layout(showlegend = TRUE)
subplot(p1,p2)
subplot(p2,p1)
</code></pre>

<p>But it doesn't work : it seems as if only one showlegend attribute was handled, so if I start with p1 I have two legend, if I start with p2 I have two. </p>

<p>Any ideas ?</p>
