Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

namem

Names of graphics objects

Syntax

  • obj_names = namem
    example
  • obj_names = namem(h)

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

Display a map in a figure window.

load korea
h = worldmap(map, refvec);
set(h, 'Visible', 'off')
geoshow(h, map, refvec, 'DisplayType', 'texturemap')
demcmap(map)

Get a list of all the names of graphics objects in the figure.

obj_names = namem
obj_names =

PLabel  
MLabel  
Parallel
Meridian
surface 
Frame   

Convert the array of names into a cell array of character vectors.

obj_names_cell = cellstr(obj_names)
obj_names_cell =

  6×1 cell array

    '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

Was this topic helpful?