File Exchange Pick of the Week

Our best user submissions

This is machine translation

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

Draggable Data Tips

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. Here’s an example.

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

Add A Comment

Your email address will not be published. Required fields are marked *

Preview: hide