Re: BarChart, Bar Labels disappear
- To: mathgroup at smc.vnet.net
- Subject: [mg26364] Re: [mg26338] BarChart, Bar Labels disappear
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Wed, 13 Dec 2000 02:41:23 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Two possibilities at first look:
1) You have to choose softer colors if you want the labels to be
visible. Then:
In[1]:=
<< Graphics`Graphics`
In[2]:=
b1 = BarChart[{-12, -18, -12, -7}, BarStyle -> {RGBColor[0.7, 1, 0]},
DisplayFunction -> Identity];
In[3]:=
b2 = BarChart[ {8, 18, 14, 10}, BarStyle -> {RGBColor[0, 0.7, 1]},
DisplayFunction -> Identity];
In[4]:=
Show[b1, b2,
Epilog -> {Text["<1%", {1, 0}, {0, 1}], Text["1%-2%", {2, 0}, {0, 1}],
Text["2%-3%", {3, 0}, {0, 1}], Text[">3%", {4, 0}, {0, 1}]},
DisplayFunction -> $DisplayFunction]
2) You may use StackedBarChart with Frame option, which will place
labels on the frame (not on the x-axis, but perhaps better looking, and
you may retain your original colors red and blue):
In[1]:=
pts = {{1, 2, 3, 4}, {"< 1%", "1%-2%", "2%-3%", ">3%"}} // Transpose
Out[1]=
{{1, "< 1%"}, {2, "1%-2%"}, {3, "2%-3%"}, {4, ">3%"}}
In[2]:=
StackedBarChart[{-12, -18, -12, -7}, {8, 18, 14, 10}, Frame -> True,
FrameTicks -> {pts, Automatic}]
Tomas Garza
Mexico City
<Matthias.Bode at oppenheim.de> wrote:
> Dear colleagues,
>
> with
> << Graphics`Graphics`
>
> this
>
> Show[BarChart[{-12, -18, -12, -7},
> BarLabels -> {"< 1%", "1%-2%", "2%-3%", ">3%"}],
> BarChart[ {8, 18, 14, 10}, BarStyle -> {RGBColor[0, 0, 1]},
> BarLabels -> {"< 1%", "1%-2%", "2%-3%", ">3%"}]]
>
> produces three bar charts.
> Only the second one shows the bar labels.
> I need the bar labels in the combined chart along the x-axis. How?