plot.r 934 B

123456789101112131415161718
  1. library(ggplot2)
  2. d <- read.table("perf.dat", header=TRUE, fill=TRUE)
  3. listOPs <- c("acceder", "remplir", "supprimer")
  4. listStructs <- c("arraylist", "hashmap", "vector")
  5. for (operation in listOPs) {
  6. ggplot(d[d$Operation == operation ,], aes(x=n, y=Temps, color=Structure)) +
  7. geom_point() + geom_smooth() +
  8. ggtitle(operation) + xlab("Nombre d'éléments") + ylab("Temps d'exécution") +
  9. theme(plot.title = element_text(hjust = 0.5)) + facet_grid(Structure ~ Operation)
  10. ggsave(paste(operation, "_tps.png", sep=""))
  11. ggplot(d[d$Operation == operation ,], aes(x=n, y=Mem, color=Structure)) +
  12. geom_point() + geom_smooth() +
  13. ggtitle(operation) + xlab("Nombre d'éléments") + ylab("Consommation mémoire") +
  14. theme(plot.title = element_text(hjust = 0.5)) + facet_grid(Structure ~ Operation)
  15. ggsave(paste(operation, "_mem.png", sep=""))
  16. }