Re: BarChart - intensity of colour increases up the bar
- To: mathgroup at smc.vnet.net
- Subject: [mg81844] Re: BarChart - intensity of colour increases up the bar
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 4 Oct 2007 04:36:08 -0400 (EDT)
- Organization: Uni Leipzig
- References: <fdvq2s$lhe$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi,
Needs["BarCharts`"]
bc = BarChart[{1, 2, 3}, BarStyle -> Directive[Opacity[0.5], Red]]
bc /. Rectangle[{x1_, y1_}, {x2_, y2_}] :> Polygon[
{{x1, y1}, {x2, y1}, {x2, y2}, {x1, y2}},
VertexColors -> {
{1, 0, 0, 1}, {1, 0, 0, 1}, {1, 0, 0, 0.25}, {1, 0, 0, 0.25}}]
Regards
Jens
tomfabtastic at hotmail.com wrote:
> Hello,
>
> I am just wondering whether there is an easy way to shade bars in a
> bar chart, so that the intensity of the colour increases as you go up
> the bar. I guess Opacity will be involved but am not sure how.
>
> This shading should be the same for each bar, regardless of the height
> of the bar. So in the below example, each bar starts with the same
> opacity along the x-axis and each finishes with a dense red at the top
> (or Opacity[1.0]).
>
> Needs["BarCharts`"]
> BarChart[{1, 2, 3}, BarStyle -> Directive[Opacity[0.5], Red]]
>
> Regards,
> Tom
>
>