This was also a problem for me; in particular, I wanted to see the DisplayName property of a graphic in the list. I used a workaround when I created the callback function, so that when I click on the data point, DisplayName will be displayed. This can be useful if you have a graph of many lines and you want to see a DisplayName for a specific one. First you need to set the DisplayName property for graphic objects for this, since by default it is empty. You can also use this to display other properties, such as Color or LineStyle, that are displayed in the chart browser:
%Based on %http://www.mathworks.com/help/matlab/ref/datacursormode.html %'fig_h' is the figure handle dcm_obj = datacursormode(fig_h); set(dcm_obj,'UpdateFcn',@myupdatefcn)
And then include this function as a separate file in the Matlab path or paste in the function you are writing now and add an extra end at the end of this function:
function name = myupdatefcn(empt,event_obj) % Customizes text of data tips tar = get(event_obj,'Target'); name = get(tar,'DisplayName'); end
source share