MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

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
> 
> 


  • Prev by Date: Re: Precision when solving a system of differential equations
  • Next by Date: problem with contourplot
  • Previous by thread: BarChart - intensity of colour increases up the bar
  • Next by thread: Re: Re: BarChart - intensity of colour increases up the bar