I would like to plot a stacked bar chart for a matrix of data containing both positive and negative values.
I used the code below and I was expecting all positive values stacked above x-axis and all negative values stacked below x-axis but this is not the case.
test<-matrix(c(1,-2,-3,4,5,-6),ncol=2)
colnames(test)=c("A","B")
rownames(test)=c("x","y","z")
barplot(test)
If I look at the help
I can't find something about this specific topic.
Do I have to use some extra command or extra parameter to achieve that?