Mapping Toolbox    

Working with Objects by Name

The Mapping Toolbox also allows you to manipulate displayed objects by name. Many mapping commands assign descriptive names to the Tag property of the objects they create. The name functions allow you to control the display of groups of similarly named objects, determine the names and change them if so desired, and use the name in the Handle Graphics set and get commands. There is also a Mapping Toolbox graphical user interface, mobjects, to help you manage the display and control of objects.

Some mapping display functions like framem, gridm, and contourm assign object tags by default. You can also set the name upon display by assigning a string to the Tag property in mapping display functions that allow property-value pairs. If the Tag does not contain a string, the name falls back to an object's Type property, such as 'line' or 'text'.

Display a vector map of the world:

You can view the names of the objects in the current axes using namem:

Change the line width of the coastline:

Use a graphical user interface to pick objects and change their colors. Be sure to use the right property name. Patches, for example, have a 'FaceColor' and 'EdgeColor', while most other objects simply have 'Color'.

Change the color of any objects with tags containing the substring 'line'.

Hide, then show all of the objects of type 'text', regardless of their tags:

For more information on the use of these functions and tools, consult the handlem, hidem, showm, clmo, namem, tagm, and mobjects reference pages in the online Mapping Toolbox reference documentation.


  Interactive Text Specialized Map Functions