MathGroup Archive 2009

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

Search the Archive

Re: Detect automatically chosen value for PlotRange in Epilog?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105806] Re: Detect automatically chosen value for PlotRange in Epilog?
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Sun, 20 Dec 2009 06:52:37 -0500 (EST)
  • References: <hgid89$o00$1@smc.vnet.net>

"Chris Rodgers" <see-rodgers-org-uk-for-contact-details at invalid.gg> wrote in 
message news:hgid89$o00$1 at smc.vnet.net...
> Hi,
>
> I want to add some arrows to a plot, like this:
>
> Plot[0, {x, -5, 5},
>  Epilog -> {Red, Arrow[{{#, 0}, {#, 1}}] & /@ Range[-10, 500]}]
>
> When plotting more complicated functions, can I detect inside Epilog
> what value Mathematica chose for the PlotRange?
>

Since the plot is not yet made, you can't?

How about making the plot first, without the Epilog, get the plotrange, then 
do it again, once you know the range?  like this

p=Plot[f[x],{x,-5,5}];
pr=PlotRange/.AbsoluteOptions[p];

Now you know the range used, so you can use it.  (make sure you do not 
change things next time, like add PlotRange so as not to affect the range 
again). I am ssuming that Epilog does not affect plot range, I think this is 
the case, but you can double check this first.

> I looked at AbsoluteOptions[...], but I don't know how to get the handle
> for the currently plotting graphics object.
>
> My aim is to restrict my arrow drawing so that I only attempt to draw
> arrows that will actually appear in the plot. I hope this will speed
> things up.
>
> Thanks,
>
> Chris.
>




  • Prev by Date: Re: CellChangeTimes?
  • Next by Date: Re: CellChangeTimes?
  • Previous by thread: Detect automatically chosen value for PlotRange in Epilog?
  • Next by thread: Re: Detect automatically chosen value for PlotRange in Epilog?