Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

barchart

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129848] barchart
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Mon, 18 Feb 2013 06:03:23 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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?

Francisco


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"}];
Show[{
  bch,
 
  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",
   Row[{"5",
     Graphics[{Arrowheads[1], Arrow[{{1, 1}, {0., 1}}]},
      ImageSize -> {20, 40}]}], "6", "7", "8"}]

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
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 iee.lu






  • 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