File Exchange Pick of the Week

Our best user submissions

Draggable Data Tips 4

Posted by Jiro Doke,

Jiro‘s pick this week is DragDataTip by Allen.

Here’s a simple, but quite useful utility to use in conjunction with MATLAB’s data tips. It customizes the data tips so that you can drag the labels to any location for better visibility.

The entry requires you to also download and install draggable by Francois Bouffard. It is also worth noting that Allen’s entry was inspired by an earlier entry, Draggable data tips, by the famous Yair Altman. (Note that Yair’s entry does not run on R2014b or newer.)

Here’s an example of Allen’s entry in action.

hFig = figure;
hLin = plot(peaks);
grid on
title('Draggable Data Tips')
xlabel('Data Index Values')
ylabel('Acceleration (g''s)')
hFig.KeyPressFcn = {@DragDataTip,gca};

Then create some data tips using the built-in feature. Once you’re done (and turned off the datacursor mode), press Ctrl-M. This converts the standard data tips to Drag Data Tips. Then you can move the data tips to any location.

See this in action.

You can find other examples in the help of DragDataTip.

help DragDataTip

Comments

Give it a try and let us know what you think here or leave a comment for Allen.


Get the MATLAB code

Published with MATLAB® R2018b

25 views (last 30 days)  | |

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.