【发布时间】:2016-04-07 15:44:46
【问题描述】:
我正在尝试在一个闪亮的应用程序中本地绘制数十条线。线条画好后,我希望不用重画就能改变它们的样式?
在下面的示例中,为简单起见,只有 6 条迹线(行)。我只想改变第一行和第三行的不透明度,而不重绘任何东西:
library(plotly)
plot_ly(mtcars, x=mpg, y=wt, group=carb)
style(p = last_plot(), opacity=0.1) #Only modifies first line & complains : You've referenced non-existent traces
style(p = last_plot(), opacity=0.1, traces = 3) #Does not work at all
Warning: You've referenced non-existent traces
Error in p$data[[max(traces)]] : subscript out of bounds
style() 怎么用?
我搜索了很多,但找不到任何文档
感谢您的帮助
问候
【问题讨论】: