> I have a matrix with 12 rows (one for each month), 2 columns (baseflow,
> runoff). I would like to make a barplot similar to Excelâs âclustered
> column chartâ.
> Here is my matrix âxâ
> 8.258754 13.300710
> 10.180953 10.760465
> 11.012184 13.954887
> 10.910870 13.839839
> 9.023519 11.511129
> 7.189241 12.519830
> 5.925576 17.101491
> 5.211613 13.585175
> 5.039592 13.506304
> 4.462325 9.963006
> 5.586521 11.306202
> 7.739242 14.669374
> If I use barplot(x, beside=T), column 1 appears on the left side of the
> plot, and then column 2 appears on the right side of the plot. I would
> rather that they alternate, so that for month 1, I see 2 bars â column 1,
> then column 2. And so forth for months 2-12. Is there a simple way to do
> this? (In excel this is the chart option for âclustered columnâ)
Can't you just transpose x? barplot(t(x), beside=T)
-- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd.mes_at_cbs.dk Priv: PDalgd_at_gmail.comReceived on Mon 14 Jun 2010 - 20:40:35 GMT
______________________________________________ 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.
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Archive generated by hypermail 2.2.0, at Mon 14 Jun 2010 - 21:00:31 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