This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

LocatorPane

LocatorPane
represents a pane with a locator at position and background back.
LocatorPane[Dynamic[pt], back]
takes the locator position to be the dynamically updated current value of pt, with the value of pt being reset if the locator is moved.
LocatorPane
sets up multiple locators at positions , , ....
LocatorPane[Dynamic[{pt1, pt2, ...}], back]
takes the locator positions to be dynamically updated current values of the .
LocatorPane
specifies the range of coordinates for the locator.
LocatorPane
uses jumps dx, dy.
  • The background in a locator pane can be a graphic or any other expression.
  • For a Graphics object g, LocatorPane by default takes the range of coordinates for pt to be the range of graphics coordinates corresponding to PlotRange in g.
  • For a general expression, LocatorPane takes the range of coordinates for pt to be 0 to 1 in each direction.
  • The following options can be given:
AppearanceAutomaticthe appearance of locators
AutoActionFalsewhether to move the locator automatically when the mouse is over it
BaselinePositionAutomatichow to align with a surrounding text baseline
BaseStyle{}base style specifications for the locator pane
ContinuousActionTruewhether to update continuously when locators are moved
EnabledAutomaticwhether the locator pane is enabled, or its locators are grayed out
Exclusions{}specific points to exclude
LocatorAutoCreateFalsewhether to allow clicks to create new locators
  • With the setting Appearance->g, all locators in the locator pane are displayed as g, where g is any graphic or other expression. »
  • LocatorPane specifies different ranges for different locators.
  • LocatorPane by default directs any click to the nearest locator.
  • The settings for BaseStyle are appended to the default style typically given by the style in the current stylesheet.
Create a locator pane with a single locator and a background image of a disk:
Create multiple locators:
Use Dynamic to connect locator positions to variables:
Do the same for multiple locators:
Create a locator pane with a single locator and a background image of a disk:
In[1]:=
Click for copyable input
Out[1]=
Create multiple locators:
In[2]:=
Click for copyable input
Out[2]=
 
Use Dynamic to connect locator positions to variables:
In[1]:=
Click for copyable input
Out[1]=
Do the same for multiple locators:
In[2]:=
Click for copyable input
Out[2]=
Use a graphic as the background:
Include an empty graphic:
Use any expression as the background:
Specify a range of coordinates for locators:
Specify both a range and jump size for locators:
Use any expression as the appearance for locators:
Use multiple locators:
Use a dynamic setting:
Connect the dynamic setting to a Slider2D:
Use any expression as the appearance for locators in LocatorPane:
Multiple locators with different appearances:
Use Appearance->None for invisible locators:
Use an invisible locator to implement a constrained movement:
By default, the locator does not change until you click in the locator pane:
By setting AutoAction, the locator changes as the mouse moves over the locator pane:
Change the background colors:
Change the background color dynamically:
By default, variables are continuously updated:
Setting ContinuousAction to False makes variable updates only when the locator is released:
By default, LocatorPane is enabled:
By setting Enabled->False, the locator is disabled but visible in its current state:
By default, each click in the locator pane will move the nearest locator:
By setting LocatorAutoCreate->True, you can use Alt+Click to create or remove locators:
By setting LocatorAutoCreate->All, create a locator on each click (Alt+Click to remove):
Make an interactive plot that runs through all locators:
Set up an array of movable random points:
Create a locator that is constrained to follow the curve:
Visualize solutions to a linear system of differential equations :
Interactive curve fit plot:
Interactive three-point circle :
LocatorPane is a special case of EventHandler:
Use Setting to extract the setting of a LocatorPane:
Use AutoAction to select the locator closest to the mouse point:
Constrain the locator to a circle:
Visualize solutions to a linear system of differential equations :
New in 6