MathGroup Archive 2007

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

Search the Archive

Re: Locator question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79382] Re: Locator question
  • From: Albert <awnl at arcor.net>
  • Date: Wed, 25 Jul 2007 05:30:16 -0400 (EDT)
  • References: <f86r55$pc7$1@smc.vnet.net>

Hi,

> You are right...it does work, however, I'd like to be able to have the locator track the function.

I'm not sure whether this is possible with Manipulate, but there are two 
  examples in the Documentation of LocatorPane which do what you need, 
here is one of them:

LocatorPane[Dynamic[pt],
  Plot[Sin[x], {x, 0, 10},
   Epilog -> {PointSize[Large],
     Point[Dynamic[{First[pt], Sin[First[pt]]}]]}], Appearance -> None]

There is also the possibility to not only make the position of the 
locator, but also the actual coordinates reflect the restriction. But 
for this you have to examine the advanced functionality of Dynamic, that 
is it's second argument :-). This is drawn from an example form the 
Documentation of Dynamic, combined with a LocatorPane and showing that 
the coordinates are really restricted, not only the position of the locator:

DynamicModule[{p = {0, 0}}, Column[{
    LocatorPane[
     Dynamic[p, (p = {#[[1]], Sin[#[[1]]]}) &],
     Plot[Sin[x], {x, 0, 10}]
     ],
    Dynamic[p]
    }]]


hth,

albert


  • Prev by Date: Re: Expand all cells?
  • Next by Date: Re: RE: Mathematica to .NET compiler
  • Previous by thread: Re: Re: Locator question
  • Next by thread: Re: Re: Locator question