Skip to content

Instantly share code, notes, and snippets.

@mikebirdgeneau
Last active August 29, 2015 14:27
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 mikebirdgeneau/3d0c5e8c79b941c054f9 to your computer and use it in GitHub Desktop.
Save mikebirdgeneau/3d0c5e8c79b941c054f9 to your computer and use it in GitHub Desktop.
library(ggplot2)
#library(png)
#test<-readPNG("~/Desktop/StormTrooper-loading.png")
#test<-round(test*9,0)
#for(i in 1:48){
# message(paste0(paste0(test[i,1:48,1],collapse=","),","))
#}
test<-matrix(data = c(
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,7,8,8,7,6,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,7,9,9,9,9,9,9,9,9,9,9,7,4,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,7,1,0,0,0,0,0,0,0,0,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,9,8,2,0,0,0,0,0,0,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,9,9,9,9,9,9,9,9,8,8,8,8,8,7,7,7,7,7,8,8,2,0,0,0,0,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,9,9,9,8,7,5,4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,0,0,0,0,5,9,9,9,9,5,5,9,4,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,6,9,8,0,0,3,9,9,9,9,9,9,9,
0,0,0,0,0,0,0,0,0,4,9,9,9,9,7,5,8,3,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,4,9,9,3,0,0,4,9,9,9,9,9,9,9,
0,0,0,0,0,0,0,0,1,9,9,9,9,9,6,7,4,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,8,9,9,1,0,0,5,9,9,9,9,9,9,9,
0,0,0,0,0,0,0,0,5,9,9,9,9,8,7,6,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,3,9,9,8,0,0,0,5,9,9,9,9,9,9,9,
0,0,0,0,0,0,0,2,8,7,8,9,9,7,6,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,7,9,9,7,0,0,0,5,9,9,9,9,8,8,8,
0,0,0,0,0,0,0,4,7,7,7,8,8,7,3,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,6,9,9,9,6,0,0,0,4,9,9,8,8,8,8,8,
0,0,0,0,0,0,0,5,6,6,7,8,7,5,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,6,9,9,8,9,5,0,0,0,3,9,8,8,8,8,8,8,
0,0,0,0,0,0,2,5,4,5,7,5,6,4,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,7,9,8,8,8,9,5,0,0,0,2,8,8,8,8,7,7,7,
0,0,0,0,0,0,3,4,4,5,5,5,7,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,3,8,9,8,8,8,7,8,4,0,0,0,0,7,8,7,7,7,7,7
),nrow=48)
opt=theme(legend.position="none",
panel.background = element_blank(),
panel.grid = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
st<-ggplot(melt(test),aes(x=Var2,y=-Var1,fill=jitter(value, amount=.15)))+geom_tile()+
scale_fill_gradientn(colours = c("grey10","steelblue4", "white"))+coord_fixed()+opt
st
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment