MathGroup Archive 2006

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

Search the Archive

Re: Axes with arrowheads !?

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

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,



  • 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 !?