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$
2
  • 1
    $\begingroup$ Yes, just put in the controls with the same variables. $\endgroup$
    – Michael E2
    Mar 14, 2014 at 19:14
  • $\begingroup$ You might find this question instructive. $\endgroup$
    – m_goldberg
    Mar 14, 2014 at 20:36

1 Answer 1

7
$\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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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