File Exchange Pick of the WeekOur best user submissions

This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the Original version of the page.

Draggable Data Tips4

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


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