MathGroup Archive 2006

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

Search the Archive

Re: Re: Axes with arrowheads !?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65637] Re: [mg65593] Re: Axes with arrowheads !?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 11 Apr 2006 04:04:51 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

This can be done a little more directly with:

Needs["DrawGraphics`DrawingMaster`"]

Draw2D[
    {Draw[Cos[x], {x, -2, 4}],
      Arrow[{0, 0}, {4.1, 0}],
      Arrow[{0, 0}, {0, 1.4}]},
    PlotRange -> {{-2.1, 4.1}, {-1.1, 1.4}},
    Axes -> True];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 

From: bghiggins at ucdavis.edu [mailto:bghiggins at ucdavis.edu]
To: mathgroup at smc.vnet.net


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: Problem with the Hannan Rissanen procedure
  • Next by Date: Re: To apply a function to a List
  • Previous by thread: Re: Axes with arrowheads !?
  • Next by thread: Re: Axes with arrowheads !?