gpt4 book ai didi

R Plotly 默认取消选择跟踪

转载 作者:行者123 更新时间:2023-12-04 13:03:57 25 4
gpt4 key购买 nike

我正在使用 R Plotly 并有一行表格:

add_trace(y = meanRank,
x = DateOnly,
data = timeSeriesDF,
name = "Daily Value",
text = hoverText,
hoverinfo = "text",
showlegend = TRUE)

它工作正常。但是,我希望在显示绘图时“未选择”此跟踪。因此,用户将在图例上单击它以显示该行。我似乎无法找到显示该参数的参数。

最佳答案

您可以添加 visible = "legendonly" :

library(plotly)
economics %>%
transform(rate = unemploy / pop) %>%
plot_ly(x = date, y = rate) %>%
loess(rate ~ as.numeric(date), data = .) %>%
broom::augment() %>%
add_trace(y = .fitted, name = "foo", visible = "legendonly")

enter image description here

reference .

关于R Plotly 默认取消选择跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39625910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com