Hello TJ,
To display the labels upon selecting a vertex, you can utilise the "datacursormode". You can use data cursor mode to explore data by interactively creating and editing data tips.
The below code snippet demonstrates how to display the coordinates of a data point, upon selection:
x = 1:10;
y = x.^2;
scatter(x,y)
dcm = datacursormode;
dcm.Enable = 'on';
dcm.UpdateFcn = @displayFunc;
function txt = displayFunc(~,info)
x = info.Position(1);
y = info.Position(2);
myDatatipText = "(%s, %s)";
txt = sprintf(myDatatipText, num2str(x), num2str(y));
end
The above code can be modified as per your use case, to display the labels instead of the coordinates of the point.
For more details, please refer to the following MathWorks documentation: datacursormode - https://www.mathworks.com/help/matlab/ref/matlab.graphics.shape.internal.datacursormanager.html
Hope this helps!