################################### #### #### too much coffee #### procrastin, 2008 #### R version 2.8.0 #### ################################### library(grid) bruit <- function(contour, ecart=0.5, n=25, open=T) { for (i in 1:n) { temp <- contour temp$x <- temp$x + rnorm(length(temp$x), mean=0, sd=ecart) temp$y <- temp$y + rnorm(length(temp$y), mean=0, sd=ecart) xspline(temp$x, temp$y, shape = rnorm(1, mean=1, sd=0.2*ecart), open = open, border = rainbow(12, gamma=1, alpha=0.5)[1]) } } t <- function(positionx, positiony, ecart, n) { x <- c(3.8,3.8,3.8,5.3,6.8 ) y <- c(9,5,2,1,2 ) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) x <- c(2.8,3.8,5.8) y <- c(6,6,6) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } o1 <- function(positionx, positiony, ecart, n){ x <- c(6.5,3.5,3.5,5.0,6.5) y <- c(4,5,2,1,2) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n, open = F) } o2 <- function(positionx, positiony, ecart, n) { x <- c(6.5,3.5,3.5,5.0,6.5) y <- c(5,4,2,1,2) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n, open = F) } m <- function(positionx, positiony, ecart, n) { x <- c(2.5,2.4,4.8,5) y <- c(1,4,4,2) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) x <- c(5, 5, 7.4, 7.5) y <- c(2,4,4,1) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } u <- function(positionx, positiony, ecart, n) { x <- c(3.5,3.5,5.0,6.5,6.5) y <- c(4,2,1,2,4) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } c2<- function (positionx, positiony, ecart, n) { x <- c(6.5,5,3.5,5.0,6.5) y <- c(3.5,4,2,1,2) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } c3<- function (positionx, positiony, ecart, n) { x <- c(6.5,5,3.5,5.0,6.5) y <- c(5,5.5,2,1,2) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } h <- function(positionx, positiony, ecart, n) { x <- c(3.8,3.8,3.8) y <- c(1.5, 1.5, 9) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n, open = T) x <- c(3.8,5.5,6.5) y <- c(3,4.8,1) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n, open = T) } f <- function(positionx, positiony, ecart, n) { x <- c(3.8,3.8,3.8,6.8,6.8) y <- c(1,5,9,9,6) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) x <- c(2.8,3.8,5.8) y <- c(5,5,5) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } e <- function(positionx, positiony, ecart, n) { x <- c(4,5.5,6.5,4,3.5,5.0,6.5) y <- c(3,3,4.5,5,2,1,2) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n) } exclam <- function(positionx, positiony, ecart, n) { x <- c(4.9,4.9,5.1,5.1) y <- c(0.9,1.1,1.1,0.9) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n, open = F) x <- c(5,5,5) y <- c(1.8,4,9) contour <- NULL contour <- data.frame(x,y) contour$x <- contour$x -2.5 + positionx contour$y <- contour$y -2.5 + positiony bruit(contour, ecart, n, open = T) } airedetracage <- function(ymax = 10, repere = TRUE){ xmin = 0 xmax = 60 ymin = 0 policevaleuraxes = 1.5 policeaxes = 2 if (repere == FALSE) { par(mar=c(1,1,1,1)) plot(NULL, xlim=c(xmin, xmax), ylim=c(ymin,ymax), type ="n", axes=FALSE, asp =1) } else { par(mar=c(2.5,2.5,1,1)) plot(NULL,xlim=c(xmin, xmax), ylim=c(ymin,ymax),xlab= " ", ylab=" ", cex.lab=policeaxes, cex.axis=policevaleuraxes,asp=1); grid() } } graphe <- function(positiony, ecart, n) { positionx <- 0.5; t(positionx, positiony, ecart, n) positionx <- positionx + 4; o1(positionx, positiony, ecart, n) positionx <- positionx + 3.5; o2(positionx, positiony, ecart, n) positionx <- positionx + 7.5; m(positionx, positiony, ecart, n) positionx <- positionx + 5; u(positionx, positiony, ecart, n) positionx <- positionx + 3.5; c2(positionx, positiony, ecart, n) positionx <- positionx + 4; h(positionx, positiony, ecart, n) positionx <- positionx + 5.5; c3(positionx, positiony, ecart, n) positionx <- positionx + 3.5; o2(positionx, positiony, ecart, n) positionx <- positionx + 4; f(positionx, positiony, ecart, n) positionx <- positionx + 4; f(positionx, positiony, ecart, n) positionx <- positionx + 3; e(positionx, positiony, ecart, n) positionx <- positionx + 3.5; e(positionx, positiony, ecart, n) positionx <- positionx + 3.5; exclam(positionx, positiony, ecart, n) } airedetracage(ymax=100, repere=F) positiony <- 17; graphe(positiony, ecart = 3, n=20) positiony <- positiony + 18; graphe(positiony, ecart = 1.5, n=20) positiony <- positiony + 12.5; graphe(positiony, ecart = 1, n=20) positiony <- positiony + 12.5; graphe(positiony, ecart = 0.5, n=20) positiony <- positiony + 12.5; graphe(positiony, ecart = 0.2, n=20) positiony <- positiony + 12.5; graphe(positiony, ecart = 0.1, n=20)