Skip to content

Instantly share code, notes, and snippets.

@epijim
Last active December 28, 2015 01:28
Show Gist options
  • Save epijim/7420268 to your computer and use it in GitHub Desktop.
Save epijim/7420268 to your computer and use it in GitHub Desktop.
bubble tables
# ggplot2 base layer
g <- ggplot(table)
# Bubble plots - edit limits and seq based on your data
(g + geom_point(aes(x = XAxis, y = YAxis, size = Percent, colour = total),shape=16, alpha=0.80) +
scale_colour_gradient(limits = c(0, 1400), low="blue", high="red", breaks= seq(0, 1400, by = 200)) +
scale_x_continuous(breaks = 1:4, labels=c("Category1", "Category2", "Category3","Category4")) +
scale_y_continuous(trans = "reverse") + coord_fixed(ratio=0.2)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment