[R] Conditional coloring

From: Pavan G <pavan.namd_at_gmail.com>
Date: Mon, 14 Mar 2011 16:06:16 -0400

Hello All,
I have a histogram with values above and below 0. I would like to color the +ve bars green and -ve bars red. I am plotting data using:

hist(a[,2],breaks=100,main="W3",xlab="Movement towards site (A)")

Can someone please comment on how it can be done? Thanks!

        [[alternative HTML version deleted]]

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 Mon 14 Mar 2011 - 20:21:47 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 Mon 14 Mar 2011 - 21:10:22 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