Re: newbie question - plot
- To: mathgroup at smc.vnet.net
- Subject: [mg33398] Re: newbie question - plot
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Wed, 20 Mar 2002 01:53:01 -0500 (EST)
- References: <a76g9i$gn3$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Mateusz" <matdob at poczta.onet.pl> wrote in message news:a76g9i$gn3$1 at smc.vnet.net... > Hello, > > What option should I use with the "Plot" command in order to obtain arrows > for x's and y's. > I mean: I want axes to be ended with arrows. Help me please. :) > > Mateusz > Mateusz: There is no option for this, but here one way getting the result. <<Graphics`Arrow`; ArrowsOnAxes[gr_, opts___?OptionQ]:= Module[{ox,oy,xmin, xmax,ymin,ymax, xst,yst}, {{ox,oy},{{xmin, xmax},{ymin,ymax}},{xst,yst}}= Last/@ AbsoluteOptions[Graphics[gr], {AxesOrigin, PlotRange, AxesStyle}]; Show[gr, Epilog->{ Append[xst, Arrow[{xmin,oy}, {xmax,oy},opts]], Append[yst, Arrow[{ox,ymin}, {ox,ymax}, opts]]} ] ] EXAMPLE gr1=Plot[Sin[x],{x,0, 7}, AxesStyle->{{Hue[.7]},{Hue[0]}}] ArrowsOnAxes[gr1] -- 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