ran*_*tic 2 r candlestick-chart googlevis
我真的很喜欢动态图表在这里的样子,但我想为其他一些图表(而不仅仅是散点图表)制作动画.
例如,是否可以设置烛台图的动画?
尽管你提出了问题,我还是会回答你好像不关心使用googleVis而只是想制作带动画的烛台图表而不考虑风格.(主要是因为我的风格很糟糕,因为googleVis图表是用非R工具制作的)
install.packages("quantmod")
install.packages("animation")
library(quantmod)
library(animation)
getSymbols("GS")
chartSeries(GS)
ani.options(interval = 0.05)
saveGIF({
for(i in 1:20){
candleChart(GS,multi.col=TRUE,theme='white',yrange=c(0,1200));
GS = GS+rnorm(3,50) ; # replace this with something interesting.
}
}, movie.name = "animation.gif", img.name = "Rplot", convert = "convert",
cmd.fun = system, clean = TRUE)
Run Code Online (Sandbox Code Playgroud)
