Hi Kai,
I don't know about ggplot, but it may be easier to do it before plotting:
set.seed(753)
testdat<-matrix(sample(1:10,9),nrow=3)
# first plot the raw matrix
barplot(testdat)
# then plot the matrix ordered by column sums
barplot(testdat[,order(colSums(testdat))])
Jim
On Fri, Sep 17, 2021 at
Hello List,
I can order the general bar chart based on frequency, using ggplot2 with the
code : aes((reorder(Var1, Freq)), Freq))
I don't know how to order stacked bar plot by total frequency
Can you give me some of example?
Thank you
Kai
[[alternative HTML version deleted]]
___
2 matches
Mail list logo