MathGroup Archive 2006

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

Search the Archive

Re: Axes with arrowheads !?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65593] Re: Axes with arrowheads !?
  • From: bghiggins at ucdavis.edu
  • Date: Mon, 10 Apr 2006 02:31:13 -0400 (EDT)
  • References: <e1ah86$1q0$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Use the Arrow package with Plot. You need to load the package first

<< Graphics`Arrow`

The strategy is to first plot your function and then use FullOptions to
extract the PlotRange that Plot uses to draw the axes. One can use that
data to contruct arrows that are aligned along the axes. Here is an
example

Block[{$DisplayFunction = Identity}, plt = Plot[Cos[
      x], {x, -2, 4}, PlotRange -> {-1, 1.5}];
  xArrow = (PlotRange /. FullOptions[plt])[[1]] /. {xmin_, xmax_} ->
Arrow[{xmin, 0}, {xmax, 0}];
  yArrow = (PlotRange /. FullOptions[plt])[[ 2]] /. {ymin_, ymax_} ->
Arrow[{0, ymin}, {0, ymax}];]
Show[plt, Epilog -> {xArrow, yArrow}]

Hope this helps,

Cheers,

Brian


  • Prev by Date: Re: Help with Identities
  • Next by Date: For Loop problem
  • Previous by thread: Axes with arrowheads !?
  • Next by thread: Re: Axes with arrowheads !?