Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Arrows on axes?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27410] Re: Arrows on axes?
  • From: vze295bp at verizon.net (David Reiss)
  • Date: Sun, 25 Feb 2001 00:53:33 -0500 (EST)
  • Organization: Scientific Arts
  • References: <96ldi4$guc@smc.vnet.net> <96nv2k$jc7@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <96nv2k$jc7 at smc.vnet.net>, "Allan Hayes"
<hay at haystack.demon.co.uk> wrote:

> Vitalij
> 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},
>  Needs["Graphics`Arrow`"];
>  {{ox,oy},{{xmin, xmax},{ymin,ymax}},{xst,yst}}=
>        Last/@
>         AbsoluteOptions[Graphics[gr], {AxesOrigin, PlotRange, AxesStyle}];
>      Show[gr,
>        Prolog->{
>            Append[xst,
>             Graphics`Arrow`Arrow[{xmin,oy}, {xmax,oy},opts]],
>            Append[yst,
>             Graphics`Arrow`Arrow[{ox,ymin}, {ox,ymax}, opts]]}
>        ]
>     ];
> 
> gr1=Plot[Sin[x],{x,0, 7},
>  AxesStyle-> Hue[0]];
> 
> ArrowsOnAxes[gr1, HeadCenter\[Rule].7];
> 
> --
> Allan
> ---------------------
> Allan Hayes
> Mathematica Training and Consulting
> Leicester UK
> www.haystack.demon.co.uk
> hay at haystack.demon.co.uk
> Voice: +44 (0)116 271 4198
> Fax: +44 (0)870 164 0565
> 
> "Vitalij K. Lysoff" <lysov at paloma.spbu.ru> wrote in message
> news:96ldi4$guc at smc.vnet.net...
> > Hello, All!
> > How to draw arrows at ends of axes?
> >


Also see my package ArrowExtended.m for a small generalization
of the Mathematica package mentioned above.
It is at:

http://www.scientificarts.com/arrowextended.html

--David

-- 
) Scientific Arts: http://www.scientificarts.com     
) Creative Services and Consultation for the Applied                            
) and Pure Sciences:: David Reiss: dreiss at !SPAMscientificarts.com
) [Remove the !SPAM to send email]


  • Prev by Date: Re: Extracting units from a list of values
  • Next by Date: Re: Extracting units from a list of values
  • Previous by thread: Re: Arrows on axes?
  • Next by thread: SubsetQ challenge