贊助

Donate

搜尋此網誌

贊助本站

Donate

2017年11月7日 星期二

R+ PhotoScape

Using R & PhotoScape to draw a sin curve animation

R code:
for (i in 1:30){
x=seq(-5*pi+i-1.6,-3*pi+i-1.6,by=.02)
y=sin(x)
png(paste0(i,".png"),width=640,height = 400)
plot(x,y,xlim=c(-3*pi,3*pi),type="l" ,ann=F)
abline(h=0)
dev.off()
}

for(i in 1:30) file.copy(from=paste0(getwd(),"/",i,".png"),to=paste0(getwd(),"/",61-i,".png"))

Using PhotoScape to make animation




沒有留言:

張貼留言

C3 plot package

R:C3 plot Peter Lin 2018-06-02 library (ggplot2) x=c( "vs" , "cyl" , "carb" , "gear" ) for...

Donate-2

Donate-2