MathGroup Archive 2001

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

Search the Archive

Re: Arrows on axes?

  • To: mathgroup at
  • Subject: [mg27268] Re: Arrows on axes?
  • From: "Allan Hayes" <hay at>
  • Date: Sun, 18 Feb 2001 02:52:06 -0500 (EST)
  • References: <96ldi4$>
  • Sender: owner-wri-mathgroup at

Essentiall, find where the ends of the axes are and use the package
Graphics` Arrow`

Here is an automation of this from my column How and Why in Mathematica in
Education and Research 8.4

Programming note: the package,  Graphics`Arrow`, is loaded internally by the
function defined below, so we have to use  the long name
Graphics`Arrow`Arrow .rather than just Arrow. This is because contexts are
assigned before evaluation, so Arrow would be given the current context,
usually "Global`", and would not access the package definitions (we would
get a message like when we enter Arrow before loading the package).
Options are passed on to Arrow.

ArrowsOnAxes[gr_, opts___?OptionQ]:=
 Module[{ox,oy,xmin, xmax,ymin,ymax, xst,yst},
 {{ox,oy},{{xmin, xmax},{ymin,ymax}},{xst,yst}}=
        AbsoluteOptions[Graphics[gr], {AxesOrigin, PlotRange, AxesStyle}];
            Graphics`Arrow`Arrow[{xmin,oy}, {xmax,oy},opts]],
            Graphics`Arrow`Arrow[{ox,ymin}, {ox,ymax}, opts]]}

gr1=Plot[Sin[x],{x,0, 7},
 AxesStyle-> Hue[0]];

ArrowsOnAxes[gr1, HeadCenter\[Rule].7];

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Vitalij K. Lysoff" <lysov at> wrote in message
news:96ldi4$guc at
> Hello, All!
> How to draw arrows at ends of axes?

  • Prev by Date: Comparing Numbers - improving on log relative error
  • Next by Date: Re: two y-axis
  • Previous by thread: Re: Arrows on axes?
  • Next by thread: Re: Arrows on axes?