Re: [R] bar plot colors

From: hadley wickham <>
Date: Mon, 17 Dec 2007 15:14:12 -0600

> I have a question regarding colors in bar plots. I want to stack a
> total of 18 cost values in each bar. Basically, it is six cost types and
> each cost type has three components- direct, indirect, and induced
> costs. I would like to use both solid color bars and bars with the
> slanted lines (using the density parameter). The colors would
> distinguish cost types and the lines would distinguish
> direct/indirect/induced. I want the cost types (i.e. colors) to be
> stacked together for each cost type. In other words, I don't want all
> of the solid bars at the bottom and all of the slanted lines at the top.

What are you trying to achieve with such a plot? A stacked bar chart only allows easy comparisons of cumulative totals (eg. cost 1, or cost 1 + 2, or cost 1 + 2 + 3) and it will be very difficult to compare individual cost types or components within a type. You might want to think about a series of line plots instead.



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 17 Dec 2007 - 21:17:27 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 17 Dec 2007 - 22:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.