Skip to content

Instantly share code, notes, and snippets.

@srgist
Last active August 29, 2015 13:56
Show Gist options
  • Save srgist/8818358 to your computer and use it in GitHub Desktop.
Save srgist/8818358 to your computer and use it in GitHub Desktop.
#https://gist.github.com/dsparks/3710171
#MELT DATA
display.brewer.all()
myPalette <- colorRampPalette(brewer.pal(7, "RdYlGn"))
zp1 <- ggplot(star3[CIN=="H2643"],
aes(x = variable, y = CIN, fill = value))
zp1 <- zp1 + geom_tile()
zp1 <- zp1 + scale_fill_gradientn(colours = myPalette(100))
zp1 <- zp1 + scale_x_discrete(expand = c(0, 0))
zp1 <- zp1 + scale_y_discrete(expand = c(0, 0))
zp1 <- zp1 + coord_equal()
zp1 <- zp1 + theme_bw()
print(zp1) # Your plot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment