2
$\begingroup$

LocatorPane constrains to Plot[curve]:

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

enter image description here

However, LocatorPane does not constrain to LogLogPlot[line]:

LocatorPane[Dynamic[pt], 
  LogLogPlot[x^3, {x, 10^0, 10^2}, 
  Epilog -> {PointSize[Large], 
  Point[Dynamic[{First[pt], First[pt]^3}]]}], Appearance -> None]

enter image description here

Anyone know how to constrain the Locator point, or better yet constrain the Locator itself to a LogLogPlot line. If possible would then like to add horizontal Slider below graph to control locator. Thanks for your time.

$\endgroup$
2
$\begingroup$

Map graphic coordinates pt to log-plot coordinates via Exp, apply function, and map back via Log:

LocatorPane[Dynamic[pt], 
 LogLogPlot[x^3, {x, 10^0, 10^2}, 
  Epilog -> {PointSize[Large], 
    Point[Dynamic[{First[pt], Exp[First@pt]^3 // Log}]]}], 
 Appearance -> None]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.