MathGroup Archive 2002

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

Search the Archive

RE: Strange Behavior of AxisOrigin

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35366] RE: Strange Behavior of AxisOrigin
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Tue, 9 Jul 2002 06:50:39 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

> -----Original Message-----
> From: AES [mailto:siegman at stanford.edu]
To: mathgroup at smc.vnet.net
> Sent: Monday, July 08, 2002 9:20 AM
> Subject: [mg35366]  Strange Behavior of AxisOrigin
> 
> 
> I'm using  Show[ Table[ Graphics[ Rectangle[ ---]]]]  to draw 
> a bunch of 
> narrow horizontal bars, all of which run from x = 0 to positive x 
> values, and all of which have y values between 1 and 10.  
> (The graphic 
> is a horizontal bar chart, essentially)
> 
> If I add  
> 
>     AxisOrigin -> {0,0}, Axes -> True  
> 
> as options for Show, this adds acceptable x and y axes to the 
> graphicm 
> with the x axis at y = 0, below the lowest bar.
> 
> But I don't want a y axis, only an x axis, so I try  
> 
>     AxisOrigin -> {0,0}, Axes -> {True,False}  
> 
> and now the horizontal (x) axis moves up on top of the lower bars, 
> somewhere around y = 1.5.
> 
> ?????
> 
> (Could using PlotRange->All have something to do with this?)
> 

I think yes, the Axes are chosen by some heuristics on the data and
influenced by options. I mostly need a little (little!) experimentation to
fine tune my output. In this case, when you need PlotRange -> All for some
reason, I'd try the Frame option instead:

In[13]:=
g = Table[
    Graphics[{Hue[s = Random[]], Rectangle[{0, i}, {10s, i + .7}]}], {i,
10}]


In[24]:=
Show[g, PlotRange -> All, Frame -> {True, False, False, False}]

another idea would be 

In[17]:=
Show[g, PlotRange -> {All, {0, 11}}, Axes -> {True, False}]



BTW, why not use BarChart?

In[25]:= <<Graphics`Graphics`

In[26]:= gdata = g[[All, 1, 2, 2, 1]]
In[27]:= gstyle = g[[All, 1, 1]]

In[28]:=
BarChart[gdata, BarStyle -> gstyle, BarOrientation -> Horizontal]

and you'll get some other add-on you might like.


--
Hartmut


  • Prev by Date: RE: Re: AppendTo VERY slow
  • Next by Date: RE: Plotting problem
  • Previous by thread: Strange Behavior of AxisOrigin
  • Next by thread: Plotting problem