Re: Styling single bar in BarChart
- To: mathgroup at smc.vnet.net
- Subject: [mg110052] Re: Styling single bar in BarChart
- From: "David Park" <djmpark at comcast.net>
- Date: Sun, 30 May 2010 23:46:34 -0400 (EDT)
populations = RandomReal[{15, 25}, 30]; mbar[m_] := BarChart[populations, Axes -> None, ChartStyle -> Table[If[i == m, Black, White], {i, 30}], BarSpacing -> Large] mbar[19] David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: dartar [mailto:dario.taraborelli at gmail.com] 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. Dario