In R plotly subplot graph, how to show only one legend?

后端 未结 4 1488
再見小時候
再見小時候 2020-12-06 11:09

I have a basic subplot with two graphs, both have a legend by default, but I want to see only one of them.

I tried this :

require(plotly)
p1 <- pl         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 11:22

    Maybe you can try a simple method. (plotly 4.9.2)

    subplot(style(p1, showlegend = F), p2)
    

    It will just show the legend of p2. Hope this works.

提交回复
热议问题