library(ggplot2) d <- read.table("perf_hypothese2.dat", header=TRUE, fill=TRUE) listOPs <- c("acceder", "remplir") listStructs <- c("arraylist", "vector") for (operation in listOPs) { ggplot(d[d$Operation == operation ,], aes(x=n, y=Temps, color=Structure)) + geom_smooth() + ggtitle(operation) + xlab("Nombre d'éléments") + ylab("Temps d'exécution") + theme(plot.title = element_text(hjust = 0.5)) + facet_grid(Structure ~ Operation) ggsave(paste(operation, "_tps_appro.png", sep="")) ggplot(d[d$Operation == operation ,], aes(x=n, y=Mem, color=Structure)) + geom_smooth() + ggtitle(operation) + xlab("Nombre d'éléments") + ylab("Consommation mémoire") + theme(plot.title = element_text(hjust = 0.5)) + facet_grid(Structure ~ Operation) ggsave(paste(operation, "_mem_appro.png", sep="")) }