Re: BarChart - intensity of colour increases up the bar
- To: mathgroup at smc.vnet.net
- Subject: [mg81873] Re: BarChart - intensity of colour increases up the bar
- From: tomfabtastic at hotmail.com
- Date: Fri, 5 Oct 2007 04:55:53 -0400 (EDT)
- References: <fdvq2s$lhe$1@smc.vnet.net><fe29o0$ncb$1@smc.vnet.net>
On Oct 4, 6:54 pm, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de> wrote: > 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 > > > > tomfabtas... 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- Hide quoted text - > > - Show quoted text - Thanks - that works well. Any idea how to apply this a StackedBarChart ? StackedBarChart[{0.5, 0.8, 1.2, 1.5, 0.6}, {1, 2, 3, 4, 5}] Thanks, Tom