Skip to content

Commit defd114

Browse files
committed
Update graph
1 parent 69d102e commit defd114

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

plot.sh

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,33 @@ draw_plot <- function(name, displayName, iguana, antlr) {
77
output <- paste(name, ".pdf", sep="")
88
pdf(output, width=12, height=6, family="CM Roman")
99

10-
boxplot(iguana$Score, antlr$Score, horizontal=TRUE, names = c("Iguana", "ANTLR"), las=2, outline=FALSE, main=displayName, xlab="Running time (milliseconds)")
10+
boxplot(iguana$Score, antlr$Score, horizontal=TRUE, names = c("Iguana", "ANTLR"), outline=FALSE, main=displayName, xlab="Running time (milliseconds)")
1111
text(x = boxplot.stats(round(iguana$Score, 2))$stats, labels = boxplot.stats(round(iguana$Score, 2))$stats, y = 0.55)
1212
text(x = boxplot.stats(round(antlr$Score, 2))$stats, labels = boxplot.stats(round(antlr$Score, 2))$stats, y = 1.55)
1313

1414
dev.off()
1515
}
1616

17+
draw_relative_plot <- function(name, displayName, data) {
18+
output <- paste(name, ".pdf", sep="")
19+
pdf(output, width=12, height=6, family="CM Roman")
20+
21+
boxplot(data, horizontal=TRUE, names = c("Relative performance"), outline=FALSE)
22+
text(x = boxplot.stats(round(data, 2))$stats, labels = boxplot.stats(round(data, 2))$stats, y = 0.55)
23+
24+
dev.off()
25+
}
26+
1727
names <- c("RxJava", "elasticsearch", "jdk7u-jdk", "guava", "junit4")
1828
displayNames <- c("RxJava", "Elastic Search", "OpenJDK 7", "Guava", "Junit 4")
1929

2030
total_iguana <- data.frame()
2131
total_antlr <- data.frame()
32+
total_relative <- c()
2233

2334
for (i in 1:length(names)) {
2435
name <- names[i]
2536
displayName <- displayNames[i]
26-
output <- paste(name, ".pdf", sep="")
27-
pdf(output, width=12, height=8, family="CM Roman")
2837

2938
iguana <- read.csv(paste("Iguana_", name, ".csv", sep=""), header=TRUE, sep=",", dec=",", stringsAsFactors=FALSE)
3039
iguana[, "Score"] <- as.numeric(iguana[, "Score"])
@@ -34,11 +43,32 @@ for (i in 1:length(names)) {
3443
antlr[, "Score"] <- as.numeric(antlr[, "Score"])
3544
total_antlr <- rbind(total_antlr, antlr)
3645

46+
print(length(iguana$Score))
47+
print(length(antlr$Score))
48+
3749
draw_plot(name, displayName, iguana, antlr)
3850
}
3951

52+
for (i in 1:length(names)) {
53+
name <- names[i]
54+
displayName <- displayNames[i]
55+
56+
iguana <- read.csv(paste("Iguana_", name, ".csv", sep=""), header=TRUE, sep=",", dec=",", stringsAsFactors=FALSE)
57+
iguana[, "Score"] <- as.numeric(iguana[, "Score"])
58+
59+
antlr <- read.csv(paste("Antlr_", name, ".csv", sep=""), header=TRUE, sep=",", dec=",", stringsAsFactors=FALSE)
60+
antlr[, "Score"] <- as.numeric(antlr[, "Score"])
61+
62+
relative <- iguana$Score / antlr$Score
63+
total_relative <- c(total_relative, relative)
64+
65+
draw_relative_plot(paste("relative_", name, sep=""), displayName, relative)
66+
}
67+
4068
draw_plot("total", "All Files", total_iguana, total_antlr)
4169

70+
draw_relative_plot("relative_total", "All Files", total_relative)
71+
4272
for (name in names) {
4373
output <- paste(name, ".pdf", sep="")
4474
embedded_output <- paste("embedded_", output, sep="")

0 commit comments

Comments
 (0)