Almost there!
So my previous data example was just a small subset of my true data. I have
all the months from 2007-2009 in order. So when I create the barplot
following your script, it bins all 12 months for each year -- a stacked
barplot with 3 bars (2007,2008,2009), which I don't want. I want e
Hi:
Is this what you were expecting? Calling your data set below 'data',
# order months chronologically
data$month <- ordered(data$month, levels = c('SEP09', 'OCT09', 'DEC09'))
# Plot it...
p <- ggplot(data, aes(x = month, fill = type))
p + geom_bar(aes(weight = volume), position = 'stack')
HTH,
I'm trying to create a stacked bar chart with x=month, y=volume, and
factor=type.
volume type month
100A SEP09
200A OCT09
300A DEC09
400B SEP09
500B OCT09
600B DEC09
700C SEP09
800C
3 matches
Mail list logo