namem

Names of graphics objects

Description

example

obj_names = namem returns the names of all the objects on the current axes. The name of an object is the value of its Tag property, if specified. Otherwise, the name of the object is the value of its Type property. The values of these properties are either set at object creation or defined using the tagm function.

obj_names = namem(h) returns the name of the object (or objects) specified by the array, h.

Examples

collapse all

Load elevation data and a geographic cells reference object for the Korean peninsula. Then, display the data on a world map.

load korea5c
worldmap(korea5c,korea5cR);
geoshow(korea5c,korea5cR,'DisplayType','texturemap')
demcmap(korea5c)

Find the names of graphics objects in the figure. The namem function returns the names as a character array. Convert the array into a cell array of character vectors using cellstr.

namesChar = namem
namesChar = 6x8 char array
    'PLabel  '
    'MLabel  '
    'Parallel'
    'Meridian'
    'surface '
    'Frame   '

namesCell = cellstr(namesChar)
namesCell = 6x1 cell
    {'PLabel'  }
    {'MLabel'  }
    {'Parallel'}
    {'Meridian'}
    {'surface' }
    {'Frame'   }

Input Arguments

collapse all

Graphics objects, specified as an array.

Output Arguments

collapse all

Names of graphics objects, returned as a character array. namem removes duplicate object names from the array.

Note: Use cellstr(obj_names) to convert obj_names to a cell array of character vectors.

See Also

| | | | |

Introduced before R2006a