0
生成下拉菜单这是我对股票波动代码10只个股:为Plotly图表
##------------producing stock volatility plot---------##
p1 = ggplot(Closed_Price_Return, aes(Date, R.BPCL)) + geom_line(color = "blue") +
theme_bw()
p2 = ggplot(Closed_Price_Return, aes(Date, R.TCS)) + geom_line(color = "green") +
theme_bw()
p3 = ggplot(Closed_Price_Return, aes(Date, R.CIPLA)) + geom_line(color = "red") +
theme_bw()
p4 = ggplot(Closed_Price_Return, aes(Date, R.EICHER)) + geom_line(color = "pink") +
theme_bw()
p5 = ggplot(Closed_Price_Return, aes(Date, R.INFY)) + geom_line(color = "yellow") +
theme_bw()
p6 = ggplot(Closed_Price_Return, aes(Date, R.LT)) + geom_line(color = "purple") +
theme_bw()
p7 = ggplot(Closed_Price_Return, aes(Date, R.MARUTI)) + geom_line(color = "orange") +
theme_bw()
p8 = ggplot(Closed_Price_Return, aes(Date, R.RELIANCE)) + geom_line(color = "#7fffd4") +
theme_bw()
p9 = ggplot(Closed_Price_Return, aes(Date, R.SUNPHARMA)) + geom_line(color = "#ff1493") +
theme_bw()
p10 = ggplot(Closed_Price_Return, aes(Date, R.YESBANK)) + geom_line(color = "#ff7256")+
theme_bw()
##------------Converting the ggplots into plotly objects-------##
p1 = ggplotly(p1)
p2 = ggplotly(p2)
p3 = ggplotly(p3)
p4 = ggplotly(p4)
p5 = ggplotly(p5)
p6 = ggplotly(p6)
p7 = ggplotly(p7)
p8 = ggplotly(p8)
p9 = ggplotly(p9)
p10 = ggplotly(p10)
现在我想为所有这些图表的下拉菜单按钮。请 告诉我如何继续进行按钮的代码在plotly
非常感谢您的帮助,我用第一种方法,它是很多更容易上手。 –