Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

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



  • Prev by Date: Image Processing Pixel Values Export Question
  • Next by Date: Re: Import HTTP data in asynchronous/parallel way
  • Previous by thread: Re: Plotting vectors on a linear function
  • Next by thread: Re: Plotting vectors on a linear function