MathGroup Archive 2010

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

Search the Archive

Re: Styling single bar in BarChart

populations = RandomReal[{15, 25}, 30]; 

mbar[m_] :=
 BarChart[populations, Axes -> None, 
  ChartStyle -> Table[If[i == m, Black, White], {i, 30}], 
  BarSpacing -> Large] 


David Park
djmpark at  

From: dartar [mailto:dario.taraborelli at] 

I must be missing something trivial but I don't seem to be able to
find a way to highlight a single value from a list in a BarChart.

mbar = BarChart[{populations, populations[[19]]}, Axes -> None,
ChartStyle -> {White, Black}, BarSpacing -> Large];

The above generates a bar chart of the population series with
alternate black/white colour.

mbar = BarChart[{populations, Style[populations[[19]], Red]},  Axes ->
None, ChartStyle -> White, BarSpacing -> Large]

This produces only white bars.

Feedback welcome.


  • Prev by Date: Re: loop for with plot
  • Next by Date: Re: loop for with plot
  • Previous by thread: Big memory needed
  • Next by thread: Re: Styling single bar in BarChart