# Manipulate a 2D point controlled simultaneously by Locator and its coordinates

I'm trying to have a point in the plane which can be manipulated both using Locator as well as inserting its $x$ and $y$ coordinates. My attempts at doing this are:

Manipulate[Graphics[Point[p], PlotRange -> 1], {{p, {1, 1}}, Locator},
{p[[1]], -1, 1}, {p[[2]], -1, 1}]


which doesn't even run, as well as

Manipulate[Graphics[Point[p], PlotRange -> 1], {{p, {1, 1}}, Locator},
{p[1], -1, 1}, {p[2], -1, 1}]


which runs, but fails to see that p[1], p[2] should be the coordinates of p.

I've managed to use a 2DSlider:

Manipulate[Graphics[Point[p], PlotRange -> 1], {{p, {1, 1}}, Locator},
{p, {-1, -1}, {1, 1}}]


but even here, I can't input the exact coordinates.

My question is:

How can one give the exact coordinates of the point p in Manipulate, as well as control its position using a Locator?

One can add the option Appearance -> "Labeled" to a Slider2D to have the current values shown as an editable label.

Manipulate[
Graphics[{PointSize[Large], Point[p]},
PlotRange -> 1], {{p, {1, 1}}, {-1, -1}, {1, 1},
Appearance -> "Labeled"}]


Using two 1D Slider

Manipulate[
Graphics[{PointSize[Large], Point[{px, py}]},
PlotRange -> 1], {{px, 1}, -1, 1, Slider,
Appearance -> "Labeled"}, {{py, 1}, -1, 1, VerticalSlider,
Appearance -> "Labeled", ControlPlacement -> Left}]


Having several interconnected control types:

point = Graphics[{PointSize[Large], Point[{0, 0}]}, PlotRange -> 1];

Manipulate[
Graphics[{}, PlotRange -> 1, Frame -> True], {{p, {1, 1}}, Locator,
Appearance -> point, TrackingFunction -> (p = #; {px, py} = p; &)},
{{p, {1, 1}}, {-1, -1}, {1, 1}, Appearance -> "Labeled",
TrackingFunction -> (p = #; {px, py} = p; &)},
{{px, 1}, -1, 1, Slider, Appearance -> "Labeled",
TrackingFunction -> (px = #; p[[1]] = px; &)},
{{py, 1}, -1, 1, VerticalSlider, Appearance -> "Labeled",
ControlPlacement -> Left,
TrackingFunction -> (py = #; p[[2]] = py; &)},
{{px, 1}, InputField, ControlPlacement -> Bottom,
TrackingFunction -> (px = #; p[[1]] = px; &)},
{{py, 1}, InputField, ControlPlacement -> Bottom,
TrackingFunction -> (py = #; p[[2]] = py; &)}]


• Thanks, but I prefer controlling the coordinates separately. Jul 7, 2015 at 8:15
• I'm having difficulties doing that. Could you please elaborate? Jul 7, 2015 at 8:18
• Sorry, but I don't think you can move the point using locator as well. Jul 7, 2015 at 8:39
• @user1337 I added a version with several different interconnected controllers. You can keep the ones you want and remove the others from the code. Jul 7, 2015 at 9:05

    Manipulate[