I have a basic subplot with two graphs, both have a default legend, but I want to see only one of them.
I tried this:
require(plotly)
p1 <- plot_ly(data=iris,x=~Sepal.Length,y=~Sepal.Width,split=~Species) %>% layout(showlegend = FALSE)
p2 <- plot_ly(data=iris,x=~Sepal.Length,y=~Sepal.Width,split=~Species) %>% layout(showlegend = TRUE)
subplot(p1,p2)
subplot(p2,p1)
But this does not work: it seems that only one showlegend attribute has been processed, so if I start with p1, I have two legends, if I start with p2, I have two.
Any ideas?
source
share