[R] Histogram with colors according to factor

From: Hans W. Borchers <hwborchers_at_googlemail.com>
Date: Tue, 08 Jul 2008 04:22:56 -0700 (PDT)

Given a data frame with a continuous variable and a factor. I would like to generate a histogram of the continuous variable, where each bar is filled with different colors according to the percentage of factor values falling into this region of the continuous variable.

I looked into packages like 'lattice' and 'ggplot2'. Searching R-help revealed that 'histogram' is spelled 'histogramm' in almost 2% of the time. I now know how to color whole bars, but did not find a solution for this specific kind of visualization.

Many thanks in advance, Hans Werner Borchers



Hans W. Borchers
ABB Corporate Research


Hans W. Borchers
ABB Corporate Research Germany
-- 
View this message in context: http://www.nabble.com/Histogram-with-colors-according-to-factor-tp18336930p18336930.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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 Tue 08 Jul 2008 - 11:26:25 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 Tue 08 Jul 2008 - 14:31:12 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