注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
Love fireworks but hate waiting until July 4th and being required to go outside to see them? Now you can see them without leaving the comfort of R!
x=seq(from=0,to=0.5,by=0.002)
x=as.vector(matrix(c(-x,x),nrow=2,byrow=TRUE))
y=sin(abs(x))
const<-c(-0.25,-2,-4,-8,-16,-64,-256)
par(bg="black")
plot(x,y,type="n",xlim=range(x),ylim=c(-6,6),col="purple",xaxt="n",xlab=NA,yaxt="n",ylab=NA)
.1point3acres
for(fw in 1:10){
color<-sample(c(2:8),1)
offset<-runif(1,-.5,.5)
offset2<-runif(1,-1,1)
for (j in 1:length(x)).--
{
for (i in 1:length(const))
{
points(x[j]+offset,const[i]*x[j]^2-offset2,col=color,pch=19)
points(x[j]+offset,i*sin(abs(x[j])*i)-offset2,col=color,pch=19)
}
}.--
.google и
Sys.sleep(1)
}
|