Skip to content
Prev 285522 / 398502 Next

ggplot rank stack bar automatically.

Hi vd,

The answer to the first part of your question is reorder. To continue the 
learnr example:


df.m <- transform(df.m, Period = reorder(Period, -1*value))

ggplot(df.m, aes(x = Period, y = value/1e+06, fill = Region))  +
  geom_bar(stat = "identity", position = "stack")

For the second question: please give a reproducible example.

Best,
Ista
On Wednesday, February 15, 2012 08:34:26 AM vd3000 wrote: