The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: barchart
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Alexei Boulbitch

Posts: 483
Registered: 2/28/08
Posted: Feb 18, 2013 6:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.