Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Faceted Pie chart
# Location and libraries
require(reshape)
require(ggplot2)
setwd('~/Dropbox/quantumforest')
# Reading data and melting into long shape
bub = read.csv('bubble-data.csv', header = TRUE)
bub2 = melt(bub, id = 'year')
names(bub2)[2] = 'worry'
levels(bub2$worry)[3] = 'Something else'
# Pie charts; no, really, pie charts!
crazyPalette = scale_fill_manual(values = c('#7DADDD', '#EF1C22', '#BEC7D6'))
crazy = ggplot(bub2, aes(x = factor(1), y = value, fill = worry))
crazy = crazy + geom_bar(width = 1) + coord_polar(theta = 'y') +
facet_wrap(~ year) + crazyPalette +
scale_x_discrete('Worry per year (%)') + scale_y_continuous('')
crazy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.