How to capture the names or indexes in a variable using gname?

Hi,
I am using gscatter to plot my data and eventually I would like to select and identify some points that cluster together and see what is happening to them.
This is what I am using:
gscatter(x,y,names) ;
mycluster=gnames(names);
I get printed correctly the names of the data points but the resulting variable mycluster is a vector with a set of float numbers that I don't know how are related to the points I have picked.
So my question is: is there anyway to capture the names in a variable instead of get them printed on the plot?

Answers (1)

The floating point numbers are handles to the plot text objects...to find out which is which,
cats = get(mycluster,{'string'});
which will return cell array of the names for each handle.

Categories

Asked:

on 20 Jun 2014

Answered:

dpb
on 20 Jun 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!