R Plotly Deselect trace by default
问题 I am ussing R Plotly and have a line of the form: add_trace(y = meanRank, x = DateOnly, data = timeSeriesDF, name = "Daily Value", text = hoverText, hoverinfo = "text", showlegend = TRUE) It works fine. However, I want this trace to be "unselected" when the plot is shown. So a user would click it on the legend to show the line. I can't seem to find the parameter to show that. 回答1: You could add visible = "legendonly" : library(plotly) economics %>% transform(rate = unemploy / pop) %>% plot_ly