3
$\begingroup$

Is there a way to have two controls that govern a single variable in a Manipulate? Specifically, I am using a Locator to select an {x,y} coordinate, but I would also like the user to be able to directly specify x and y, in InputFields.

Similar questions have been asked, but not with Manipulate and not with a 2D variable.

$\endgroup$
  • 1
    $\begingroup$ Yes, just put in the controls with the same variables. $\endgroup$ – Michael E2 Mar 14 '14 at 19:14
  • $\begingroup$ You might find this question instructive. $\endgroup$ – m_goldberg Mar 14 '14 at 20:36
6
$\begingroup$

For example:

Manipulate[
 LocatorPane[Dynamic[{x, y}], Graphics[{Red, Disk[]}]],
 {{x, 0}, InputField},
 {{y, 0}, InputField}
 ]

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.