Locator
Locator[{x,y}]
represents a locator object at position {x,y} in a graphic.
takes the position to be the dynamically updated current value of pos, with this value being reset if the locator object is moved.
Locator[{x,y},obj]
displays obj as the locator object.
Details and Options
- Locator[{x,y},Automatic] uses the default "crosshairs" appearance for the locator object.
- Locator[Dynamic[{x,y}]] will reset the values of x and y when the locator object is moved; Locator[{x,y}] will not.
- Locator[Dynamic[{x,y}],None] gives no directly visible indication of position, but can be used in conjunction with a construct such as Point[Dynamic[{x,y}]]. »
- Locator objects that appear inside Deploy[expr] can still be manipulated interactively, just like, for example, Slider objects. »
- If obj does not define its own absolute size, its size when used as a locator object can be specified using the ImageSize option of Locator.
- The setting for ImageSize can be Tiny, Small, Medium, Large, or an explicit value in printer's points. »
- The center of the locator object is taken to be the setting for the AlignmentPoint option of obj, or by default, the center of the bounding box for obj.
- The following options can be given:
-
Appearance Automatic basic appearance of the locator AutoAction False whether to move automatically when the mouse is over the graphic Enabled Automatic whether the locator is enabled, or grayed out ImageSize Automatic the size of the displayed locator object LocatorRegion Automatic where the locator object should be allowed to go - Locator[] is equivalent to Locator[Scaled[{0.5,0.5}]]. »
- Locator can be used to specify the control for a variable in Manipulate, to indicate that the value of the variable should be determined by the position of a locator. »
Examples
open allclose allBasic Examples (3)
Set up a locator that can move in a graphic:
Set up locator that defines the value of p:
Put a locator in a Manipulate:
Scope (7)
Locator Content (4)
Options (11)
AutoAction (2)
By default, no locator values change until you drag the locator:
When AutoAction is set, the locator values change as the mouse moves over the locator:
Enabled (2)
LocatorRegion (2)
By default, Locator is constrained within the PlotRange:
Use LocatorRegion->Full to access all of the graphics:
Applications (2)
Properties & Relations (2)
Use Deploy to restrict graphics interactivity while keeping the locators active:
Use LocatorPane to use locators on complex objects:
Text
Wolfram Research (2007), Locator, Wolfram Language function, https://reference.wolfram.com/language/ref/Locator.html.
CMS
Wolfram Language. 2007. "Locator." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Locator.html.
APA
Wolfram Language. (2007). Locator. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Locator.html