[R] Stacked bar plot anomaly When column contains a negative and a positive value

From: Murray Richardson <murray.richardson_at_utoronto.ca>
Date: Sat, 03 May 2008 15:29:41 -0400


Hello users,

I've noticed a problem when creating a stacked column plot when a column contains a negative and a positive value. e.g.

series1<-c(-1,-2, 3, 4, 5)
series2<-c( 5, -4,-3,-2, 1)
data<-rbind(series1,series2)
barplot(as.matrix(data), beside=FALSE)

In these cases (i.e. first, third and fifth columns) the plotting is not handled correctly. Compare this output with that of:

barplot(as.matrix(data), beside=TRUE)

Shouldn't the plots look the same except in the beside=FALSE scenario the constituent bars should not be juxtaposed but instead are one on top of the other?

Thanks for any advice!

Murray Richardson



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 03 May 2008 - 19:48:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 03 May 2008 - 20:31:55 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive