Re: Bug in Package Graphics`Graphics` ?
- To: mathgroup at smc.vnet.net
- Subject: [mg26387] Re: [mg26348] Bug in Package Graphics`Graphics` ?
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Sat, 16 Dec 2000 02:40:16 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
No bug here, I'm afraid. First you ask to restrict the PlotRange, but
forget to change the AxesOrigin. See what happens if you say
In[1]:=
<< Graphics`Graphics`
In[2]:=
BarChart[{4, 10, 5, 7}, PlotRange -> {3, 10},
AxesOrigin -> {0, 3}]
But now you have lost the horizontal axis labels. Then try:
In[3]:=
BarChart[{4, 10, 5, 7}, PlotRange -> {3, 10},
AxesOrigin -> {0, 3}, Epilog -> {Text["1", {1, 3}, {0, 1}], Text["2",
{2, 3}, {0, 1}],
Text["3", {3, 3}, {0, 1}], Text["4", {4, 3}, {0, 1}]}]
You have your labels back. The problem is now that the default red color
looks very strong. Then try something softer, and add a line along what
should be the new horizontal axis:
In[4]:=
BarChart[{4, 10, 5, 7}, BarStyle -> {RGBColor[0.9, 0.9, 0.9]},
PlotRange -> {3, 10}, AxesOrigin -> {0, 3},
Epilog -> {Text["1", {1, 3}, {0, 1}], Text["2", {2, 3}, {0, 1}],
Text["3", {3, 3}, {0, 1}], Text["4", {4, 3}, {0, 1}],
Line[{{0, 3}, {4.5, 3}}]}]
This looks more or less right. Ah, and you have also taken care of the
problem when negative values are present, since now the labels don't go
away:
In[5]:=
BarChart[{-4, 10, 5, 7},
Epilog -> {Text["1", {1, 0}, {0, 1}]}]
I myself don't go in for BarChart-ing, since I find it rather limited. I
prefer to start from scratch and use graphics primitives to construct
the bars whenever I have interesting charts to make.
Tomas Garza
Mexico City
"Ludsteck" <Ludsteck at zew.de> wrote:
> Dear Mathgroup members,
> I am very cautious in claiming to have found a bug in Mathematica, but
> here I am almost sure.
> After loading the package
> <<Graphics`Graphics`
>
> I tried to plot a simple BarChart:
>
> BarChart[{4,10,5,7}]
>
> However, if I want to restrict the plot range
>
> BarChart[{4,10,5,7}, PlotRange->{3,10}]
>
> Mathematica does not respond with an error message, but
> still plots in the range {0,10}. (However, the y-axis is not visible
in
> {0,3}.)
> Furthermore, bar edges are visible only in the range {3,10}.
> Finally, if the input list contains negative values, the bars hide the
> BarLabels
> which is desastrous in my application.
>
> I am really an adherent of Mathematica, but if I am right here I have
to
> state that it is not possible to create publication quality BarCharts
with
> Mathematica. (At least not with the
> Add-On function BarChart.)
>
> Any suggestions?