Skip to content

Instantly share code, notes, and snippets.

@cavedave
Created March 10, 2016 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cavedave/779fa728bc1809f6d8df to your computer and use it in GitHub Desktop.
Save cavedave/779fa728bc1809f6d8df to your computer and use it in GitHub Desktop.
#Package Wes Anderson colours R package https://github.com/karthik/wesanderson#wes-anderson-palettes
#His Box Office http://www.boxofficemojo.com/people/chart/?id=wesanderson.htm
#His IMDB http://www.imdb.com/name/nm0027572/
# wes csv is
#Name,IMDB,Earn,Year,Era
#The Grand Budapest Hotel,8.1,62,2014,later
#Moonrise Kingdom,7.8,50,2012,later
#Fantastic Mr. Fox,7.8,23,2009,mid
#The Darjeeling Limited,7.2,15,2007,mid
#The Life Aquatic with Steve Zissou,7.3,33,2004,mid
#The Royal Tenenbaums,7.6,78,2001,early
#Rushmore,7.7,29,1998,early
#Bottle Rocket,7.1,1,1996,early
install.packages("wesanderson")
library(wesanderson)
library(ggplot2)
mydata = read.csv("wes.csv", header=TRUE, sep=",") # read csv file
ggplot(mydata, aes(IMDB, Earn, color = Era)) +
geom_point(size = 3) +
scale_color_manual(values = wes_palette("GrandBudapest")) +
theme_gray()+ ggtitle("Wes Anderson Films\n")+ylab("Earn Millions $")+xlab("IMDB Rating")+
geom_text(aes(label=Name),hjust=0.4, vjust=-.8)
ggsave("plot.png", width=12, height=10, dpi=200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment