library(ggplot2)

d <- read.table("perf.dat", header=TRUE, fill=TRUE)

op <- c("acceder", "remplir", "supprimer")
struct <- c("arraylist", "hashmap", "vector")
for (operation in op) {
    for (structure in struct) {
        ggplot(d[d$Operation == operation & d$Structure == structure,], aes(x=n, y=Temps, color=Structure)) +
            geom_point() + geom_smooth() +
            ggtitle(paste(operation, structure, sep = " ", collapse = NULL)) + xlab(paste("Taille", structure, sep = " ", collapse = NULL)) + ylab("Temps d'exécution") +
            theme(plot.title = element_text(hjust = 0.5))
        ggsave(paste(operation, "_", structure, ".png", sep = "",collapse = NULL))
    }
}






#ggplot(d,aes(x=n,y=Mem,colour=Structure,shape=Operation))+geom_point()+facet_grid(Structure~Operation)
