Re: Plotting vectors on a linear function

*To*: mathgroup at smc.vnet.net*Subject*: [mg125971] Re: Plotting vectors on a linear function*From*: Murray Eisenberg <murray at math.umass.edu>*Date*: Tue, 10 Apr 2012 02:30:34 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*References*: <201204090935.FAA28511@smc.vnet.net>*Reply-to*: murray at math.umass.edu

The way to do it is to construct the arrows as a list of Arrow objects and then include these as an Epilog option to the Plot function. For example: f[x_] := 1 - x g[x_] := 0.25 (2 x + 1) myArrows = Table[Arrow[{{x, f[x]}, {x + 0.1, g[x + 0.1]}}], {x, 0, 1, 0.1}]; Plot[f[x], {x, 0, 1}, PlotStyle -> Black, PlotRange -> {{0, 1.1}, {0, 1.1}}, AspectRatio -> Automatic, Epilog -> {Red, myArrows}] On 4/9/12 5:35 AM, Clemens Diderot wrote: > Hi all, > > I am trying to plot a linear function (y=1-x) together in one graph with a bunch of vectors, which have their tails on the function. A bit like in this example here: http://pic.twitter.com/GRfhjPRP > > Anyone any idea? Much appreciated! > > Best > CD > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305

**References**:**Plotting vectors on a linear function***From:*Clemens Diderot <clmnsbchn@gmail.com>