diff options
Diffstat (limited to 'results/analysis2.R')
| -rw-r--r-- | results/analysis2.R | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/results/analysis2.R b/results/analysis2.R index 4af75ed..3954e07 100644 --- a/results/analysis2.R +++ b/results/analysis2.R @@ -5,8 +5,8 @@ library(RColorBrewer) data=read_csv("results.csv") r_=function(x){round(x,digits=1)} -color=function(){scale_fill_manual(values = c("#00AFBB", "#E7B800", "#FC4E07"))} -color2=function(){scale_fill_brewer(palette = "Dark2")} +color=function(){scale_fill_brewer(palette = "Accent")} +color2=function(){scale_fill_brewer(palette = "Set2")} nolegend=function(){theme(legend.position="none")} simkeys=unique(data$simkey) nsimkeys=length(simkeys) @@ -58,7 +58,7 @@ energy60P=ggplot(energy60%>%dformat,aes(x=simkey,y=energy,fill=type))+ geom_label(data=success60%>%dformat(),aes(label = success_txt, y=35),label.padding=unit(0.35,"lines"),label.r=unit(0.09,"lines"),fill="#f0f0f0",label.size=0.5,fontface="bold",colour="black",position=position_dodge(0.9))+ facet_wrap(~wireless)+ xlab(element_blank())+ylab("Energy consumption (J)")+ - labs(fill="Energy:")+theme(legend.position="top")+color()+coord_cartesian(ylim=c(0,1200)) + labs(fill="60s uptime:")+theme(legend.position="top")+color()+coord_cartesian(ylim=c(0,1200)) #ggsave("energy-60sec.png",width = 12,height=4.8) energy180=data%>%filter(wakeupfor==180) @@ -86,7 +86,7 @@ energy180P=ggplot(energy180%>%dformat,aes(x=simkey,y=energy,fill=type))+ geom_label(data=success180%>%dformat(),aes(label = success_txt, y=100),label.padding=unit(0.35,"lines"),label.r=unit(0.09,"lines"),fill="#f0f0f0",label.size=0.5,fontface="bold",colour="black",position=position_dodge(0.9))+ facet_wrap(~wireless)+ xlab(element_blank())+ylab("Energy consumption (J)")+ - labs(fill="Energy:")+theme(legend.position="top")+color()+coord_cartesian(ylim=c(0,2600)) + labs(fill="180s uptime:")+theme(legend.position="top")+color2()+coord_cartesian(ylim=c(0,2600)) #ggsave("energy-180sec.png",width = 12,height=4.8) totalUptime60=data%>%filter(wakeupfor==60) @@ -164,4 +164,5 @@ success180P=ggplot(success180%>%dformat,aes(x=simkey,y=success))+ ggsave("60sec.pdf",plot=(energy60P)/(totalUptime60P)+ plot_layout(guides = "collect")&theme(legend.position = "top"),width=12,height=7) ggsave("180sec.pdf",plot=(energy180P)/(totalUptime180P)+ plot_layout(guides = "collect")&theme(legend.position = "top"),width=12,height=7) +ggsave("results.pdf",plot=(energy60P)/(energy180P)+ plot_layout(guides = "collect")&theme(legend.position = "top"),width=12,height=7) |
