Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用theme参数更改条形的颜色,但出现错误:
theme
library(quantmod) getSymbols("SPY", from=Sys.Date()-500, to=Sys.Date()) chart_Series(SPY) chart_Series(SPY,theme=chart_theme(dn.col = "cyan")) # Error in chart_theme(dn.col = "cyan") : unused argument (dn.col = "cyan")
看代码。chart_theme不接受任何争论,所以尝试chart_theme(dn.col="cyan")是没有意义的。
chart_theme
chart_theme(dn.col="cyan")
> args(chart_theme) function () NULL
chart_theme()返回一个列表,并且您想要修改它的一部分,所以就这样做。
chart_theme()
myTheme <- chart_theme() myTheme$col$dn.col <- "cyan" chart_Series(SPY,theme=myTheme)