Skip to content

Instantly share code, notes, and snippets.

@edipofederle
Created September 29, 2014 12:24
Show Gist options
  • Save edipofederle/d56e3dcb1fc304087524 to your computer and use it in GitHub Desktop.
Save edipofederle/d56e3dcb1fc304087524 to your computer and use it in GitHub Desktop.
df <- data.frame(time = factor(c("NSGA-II AGM","PAES AGM","NSGA-II MM","PAES MM", "NSGA-II BET","PAES BET"), levels=c("NSGA-II AGM","PAES AGM","NSGA-II MM","PAES MM", "NSGA-II BET","PAES BET")),
total_time = c(307, 589, 215,332,857,1153))
ggplot(data=df, aes(x=time, y=total_time)) + geom_bar(stat="identity") + xlab("PLA") + ylab("Tempo (min)")
# Map the time of day to different fill colors. These both have the same result.
ggplot(data=df, aes(x=time, y=total_time, fill=time)) + geom_bar(stat="identity") + xlab("PLA") + ylab("Tempo (min)")
ggplot(data=df, aes(x=time, y=total_time)) + geom_bar(aes(fill=time), stat="identity") + xlab("PLA") + ylab("Tempo (min)")
b <- ggplot(data=df, aes(x=time, y=total_time, fill=time)) + geom_bar(colour="black", stat="identity") + guides(fill=FALSE) + xlab("PLA") + ylab("Tempo (min)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment