-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpi_baware_all.R
64 lines (49 loc) · 1.8 KB
/
pi_baware_all.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
library(reshape2)
library(ggplot2)
library(RColorBrewer)
dta <- read.table("pi_dat/baware_consumed.dat", sep="\t", head=T)
colors <- brewer.pal(6, "Paired")
mapped_colors <- c("managed"=colors[4],"managed silent"=colors[3],"full_throttle"=colors[6], "full_throttle silent"=colors[5])
xvals <- c()
xlbls <- c()
for (i in 1:nrow(dta)) {
xvals <- c(xvals,dta$xcord[i])
lbl <- paste(dta$bench[i], dta$data[i], sep="_")
xlbls <- c(xlbls,lbl)
}
dta$vj1 <- rep(c(0,0,0), length.out=15)
dta$vj2 <- rep(c(0,0,0), length.out=15)
pdf("pi_battery_exception_saved.pdf")
dta$vj1[13] <- 2
dta$vj1[14] <- 1
dta$vj1[15] <- 1
print(dta)
p <- ggplot(data=dta, aes(xcord)) +
geom_bar(aes(y=java_managed,fill="managed silent"),
stat="identity",
width=0.15) +
geom_bar(aes(y=ent_managed,fill="managed"),
stat="identity",
width=0.15) +
geom_bar(aes(y=java_full,fill="full_throttle silent"),
stat="identity",
width=0.15) +
geom_bar(aes(y=ent_full,fill="full_throttle"),
stat="identity",
width=0.15) +
geom_text(aes(y=ent_managed,label=percent_saved,vjust=0.0+vj1),colour="blue4",size=5.5) +
geom_text(aes(y=ent_full,label=percent_saved,vjust=2.5+vj1),colour="blue4",size=5.5) +
scale_fill_manual(name="Boot Mode",values=mapped_colors) +
xlim(-0.5,6) +
xlab("Benchmark and Data Mode") +
ylab("Energy") +
theme_gray(base_size=16) +
theme(
axis.text=element_text(color="black"),
axis.text.x=element_text(angle=60, hjust = 1),
legend.position="bottom",
plot.margin=unit(c(0.2,1.0,0.0,0.0),"cm")) +
scale_x_continuous(breaks=xvals,labels=xlbls) +
ggtitle("Pi Battery Exception Relative Saved")
print(p)
dev.off()