# # ############# Spirals. # # http://en.wikipedia.org/wiki/Logarithmic_spiral x <- rnorm(100); hist(x); rm(x) # <--- resize the graphics window as large as your screen. r <- .25 theta <- seq(0, 20, by = .01) length(theta) x <- as.vector(0) y <- as.vector(0) for (i in 1:length(theta)){ x[i] <- (r*theta[i])*cos(theta[i]) y[i] <- (r*theta[i])*sin(theta[i]) plot(x, y, xlim = c(-5,5), ylim = c(-5,5), pch = 20, col = "blue") } summary(x) summary(y) plot(x,y) cor(x,y) rm(i,r,theta,x,y); graphics.off(); ls() ################################################################################ # CAUTION: The script below may induce headaches, blindness, and/or seizures. Use # at your own risk; the author of this script assumes no liablity for damages, injuries, # seizures, or any other negative consequences resulting from use of this script. x <- rnorm(100); hist(x); rm(x) # <--- resize the graphics window as large as your screen. library(RColorBrewer) r <- seq(.25, 2, by = .25) theta <- seq(0, 20, by = .01) df <- data.frame(matrix(rep(0,16), ncol = 16)) colores <- brewer.pal(8,"Blues") for (i in 1:length(theta)){ df[i,1] <- (r[1]*theta[i])*cos(theta[i]) df[i,2] <- (r[1]*theta[i])*sin(theta[i]) plot(df[,1], df[,2], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[1], xlab = "X", ylab = "Y") df[i,3] <- (r[2]*theta[i])*cos(theta[i]) df[i,4] <- (r[2]*theta[i])*sin(theta[i]) par(new = T) plot(df[,3], df[,4], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[2], xlab = "X", ylab = "Y") df[i,5] <- (r[3]*theta[i])*cos(theta[i]) df[i,6] <- (r[3]*theta[i])*sin(theta[i]) par(new = T) plot(df[,5], df[,6], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[3], xlab = "X", ylab = "Y") df[i,7] <- (r[4]*theta[i])*cos(theta[i]) df[i,8] <- (r[4]*theta[i])*sin(theta[i]) par(new = T) plot(df[,7], df[,8], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[4], xlab = "X", ylab = "Y") df[i,9] <- (r[5]*theta[i])*cos(theta[i]) df[i,10] <- (r[5]*theta[i])*sin(theta[i]) par(new = T) plot(df[,9], df[,10], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[5], xlab = "X", ylab = "Y") df[i,11] <- (r[6]*theta[i])*cos(theta[i]) df[i,12] <- (r[6]*theta[i])*sin(theta[i]) par(new = T) plot(df[,11], df[,12], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[6], xlab = "X", ylab = "Y") df[i,13] <- (r[7]*theta[i])*cos(theta[i]) df[i,14] <- (r[7]*theta[i])*sin(theta[i]) par(new = T) plot(df[,13], df[,14], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[7], xlab = "X", ylab = "Y") df[i,15] <- (r[8]*theta[i])*cos(theta[i]) df[i,16] <- (r[8]*theta[i])*sin(theta[i]) par(new = T) plot(df[,15], df[,16], xlim = c(-40,40), ylim = c(-40,40), pch = 20, col = colores[8], xlab = "X", ylab = "Y") } summary(df) rm(colores, df, i, r, theta); graphics.off(); ls() detach("package:RColorBrewer") # End; April 10, 2012.