Skip to content

Instantly share code, notes, and snippets.

@jalapic
Last active October 5, 2015 20:11
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 jalapic/7b698bc42ed968692e36 to your computer and use it in GitHub Desktop.
Save jalapic/7b698bc42ed968692e36 to your computer and use it in GitHub Desktop.
#Geom Tiling
df <- data.frame(Var1=rep(LETTERS[1:20],20),
Var2=rep(LETTERS[1:20],each=20),
Value=sample(1:100, replace=T, 400)
)
ggplot(df, aes(Var1, Var2, fill = Value)) +
geom_tile(colour="white", size=1.75, stat="identity") +
scale_fill_continuous(low="white", high="dodgerblue") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_discrete(expand = c(0, 0)) +
xlab("") +
ylab("") +
ggtitle("Geom tiling") +
theme(
plot.title = element_text(color="black",hjust=0,vjust=1, size=rel(2.3)),
plot.background = element_rect(fill="white"),
panel.background = element_rect(fill="white"),
panel.border = element_rect(fill=NA, color="white", size=0.15, linetype="solid"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.text = element_text(color="black", size=rel(1.3)),
axis.text.y = element_text(hjust=1),
legend.text = element_text(color="black", size=rel(1.3)),
legend.background = element_rect(fill="white"),
legend.position = "bottom",
legend.title=element_blank()
)
@jalapic
Copy link
Author

jalapic commented Oct 5, 2015

geomtiling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment