I am creating a stacked barplot out of a 2x2 table:
fuel.type <- c('diesel', 'gas', 'diesel', 'gas', 'diesel', 'gas', 'gas', 'gas', 'gas')
make <- c('bmw', 'wv', 'audi', 'bmw', 'audi', 'audi', 'wv', 'wv', 'wv')
table1 <- table(fuel.type, make)
barplot(table1, legend = row.names(table1))
I get the following figure:
How can i get the same plot but sorted in decreasing order??