If you have one or more line traces on your plot that are enumerated values, it makes sense to have the enumerated name pop up in the data tip rather than the value. However, if you have non-enumerated curves, putting enumerated names on them is misleading and distracting. The small update function "EnumDataTip" automatically switches between showing the enumerated names and pure values as appropriate for nicely data-tipped mixed-curve plots.
Usage is really easy:
1) Set EnumDataTip as the update function for your figure
2) When plotting an enumerated curve, add the enumerated class as user data
3) Place/move data cursors normally!
ExampleScript.m provides a sample usage case for the EnumDataTip, and the enum_* files hold the classes used by ExampleScript.
Reed (2021). Enumeration Data Tipper (https://www.mathworks.com/matlabcentral/fileexchange/45502-enumeration-data-tipper), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.