Although Sam's method is probably the right solution here, I would like to suggest one more (although it is more likely to “hack” than the right solution).
You can connect context menus for processing graphic objects. These menus can display several options and even allow your script to respond to user choices. Take a look at the following example:
x = [1:10]; y = x.^2; plot(x,y); hold on; h = plot(x(5), y(5),'ro'); %% save the handle to the point we want to annotate hcmenu = uicontextmenu; item1 = uimenu(hcmenu, 'Label', 'info 1'); item2 = uimenu(hcmenu, 'Label', 'info 2'); item3 = uimenu(hcmenu, 'Label', 'info 2'); set(h, 'uicontextmenu', hcmenu);
When you right click on the point "o", you get a context menu:

More information can be found on the Mathwork Website .
source share