Skip to content

Instantly share code, notes, and snippets.

@Coornail
Last active December 22, 2015 04:29
Show Gist options
  • Save Coornail/6417712 to your computer and use it in GitHub Desktop.
Save Coornail/6417712 to your computer and use it in GitHub Desktop.
library(ggplot2)
# Load and format data.
bb <- read.csv("bb.csv")
fr <- data.frame(idx=as.numeric(1:57), rating=bb$User.Rating, season=factor(bb$Season))
# Print graph.
png("/tmp/bb.png", width=1280, height=768)
gplot(data=fr, aes(x=fr$idx, y=fr$rating, color=season)) + geom_point(size=3) + geom_smooth(aes(group=fr$season), method="lm") + labs(x="", y="User rating", color="Season", title="Breaking Bad episode rating")
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment