Re: [R] histogram with bars colored according to a vector of values

2013-07-26 Thread Jim Lemon
On 07/26/2013 12:13 PM, john d wrote: Dear all, Let's say I have the following data.frame: dat-data.frame(x=rnorm(100), y=rnorm(100,2)) and I plot a histogram of variable x, somethink like: hist(dat$x, breaks=-5:5) Now, I'd like to color each bar according to the mean of the cases according

[R] histogram with bars colored according to a vector of values

2013-07-25 Thread john d
Dear all, Let's say I have the following data.frame: dat-data.frame(x=rnorm(100), y=rnorm(100,2)) and I plot a histogram of variable x, somethink like: hist(dat$x, breaks=-5:5) Now, I'd like to color each bar according to the mean of the cases according to y. For instance, the color of the bar