MathGroup Archive 2013

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

Search the Archive


Dear Group:

I have not managed to combine BarChart with a line.

The simple problem is the following. I have a labeled BarChart (that is, I 
use the ChartLegends options) , and I want to draw a horizontal line, to highlight the separation say between units below and above 10. But I do not see how can this be done within BarChart, and I haven't been able to combine BarChart with the line using Show or Graphics.

Can somebody help me?


Hi, Francisco,

It was not quite clear to me what is it, that you wish to achieve. If you mean that the line should cross
The bar chart itself, try this:

bch = BarChart[Range[8], ChartStyle -> "DarkRainbow",
   ChartLegends -> {"1", "2", "3", "4", "5", "6", "7", "8"}];
  Graphics[{Line[{{0, 5}, {10, 5}}]}]

If you need that one of the legend items would be highlighted, try this:

BarChart[Range[8], ChartStyle -> "DarkRainbow",
 ChartLegends -> {"1", "2", "3", "4",
     Graphics[{Arrowheads[1], Arrow[{{1, 1}, {0., 1}}]},
      ImageSize -> {20, 40}]}], "6", "7", "8"}]

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at

  • Prev by Date: Re: Stephen Wolfram's recent blog
  • Next by Date: Re: Low precision exponentiation
  • Previous by thread: Re: barchart
  • Next by thread: barchart