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 between -2 and -1 should
reflect the mean of variable y for the corresponding cases. Any suggestions?

John

	[[alternative HTML version deleted]]

