View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

5.0 | 20 ratings Rate this file 5 Downloads (last 30 days) File Size: 7.34 KB File ID: #1542 Version:
image thumbnail




25 Mar 2002 (Updated )

Interactive labeling of data points on a plot.

| Watch this File

File Information

This is an interactive data label. Just click on a point on a plot to see it's value. Drag the point around to see how the value changes. Click at another location to add a new label.
I build this back in the day before MATLAB had data tips. I'd recommend starting with them first before seeing if you like this one better (click on the button just to the right of rotate on the figure toolbar).


This file inspired Scattertext.

Required Products MATLAB
MATLAB release MATLAB 6.1 (R12.1)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (23)
08 Dec 2015 Michelle Hirsch

Ella - Just update this line of code (line 89):

th = text(xv,yv,[' (' num2str(xv) ',' num2str(yv) ')']);

This is the command that generates the text that is displayed. If you wanted to just show a raw x value, for instance, you could change it to:

th = text(xv,yv,num2str(xv));

Comment only
07 Dec 2015 Ella Sciamma-O'Brien

Hello, How can I do to display only the x label

21 Feb 2013 Muhammad Tauha Ali

it'll be really great if this function can be put in plot toolbar alongside data cursor.
The benefit of this function is that you can get row index of your data and timestamp if you like which really helps in data analysis.

18 Jan 2013 dk

dk (view profile)

Great file. I made a simple modification to output indices rather than coordinates. T This way I can identify the interesting points on a scatter plot and investigate them.

27 Jan 2012 Robert Daly

For time series data you can get the 'x coordinate' as a date string by changing line 89 to ...
th = text(xv,yv,[' (' datestr(xv) ',' num2str(yv) ')']);

When you click on a feature it will tell you when it happened as a date and time rather than a cryptic matlab date number. One area where Excel seems to be better than Matlab (until now!).

Comment only
14 Mar 2011 Victor

Victor (view profile)

Dear all,
I have a curve in 2d. Every point of this curve is correspond to another rows of a (n,3) matrix.
Is it possible with "datalabel" or do you know any other hint?

Comment only
17 Dec 2010 Juan Pedro


23 Mar 2009 Akshay B

Awesome!! Thanks!

13 Mar 2008 Engin Masazade

Very useful, thanks a lot

17 Jan 2008 ma r

Thank you so much. This is perfect.

23 Jun 2007 Elias Bwick

Thanks dude. This is exactly what I was looking for. Excellent

06 Dec 2005 Zhichao Ruan

great job

24 Apr 2005 Mo saggaf

27 Mar 2005 Mo saggaf

19 Nov 2004 Zahid Ullah Khan

Its Great... Thanks :-]

18 Apr 2004 Keven Chang

Great Great Job.

More, Is possible to have a transparent.
Back Ground.

23 Oct 2003 Andrey Loginov

Cool and easy to upgrade!
If you wish to get optional label backgrounds, text size, text color&style or even optional label position simply change input, store additional fields with "setappdata" and get them further with "getappdata".
It is also not difficult to modify code to get labels in between of XY line data points:).

23 Sep 2003 Wong Yew Leong

Cool...just what we wanted!

12 Aug 2003 Mujahid Sultan

Simply superb! great work.

23 Jul 2003 YaYa Huang

You are an excellent guy!!

17 Jul 2003 Luc Jonckheere


16 Mar 2003 Lina Chang

This added feature is great! I've always wanted to be able to this to my plots.

16 Jan 2003 Josef Nauderer

Usefull tool!!!!

08 Apr 2002

Through discussions with our developers, I realized that this file has the same name as a file that will be included in R13 (the capabilities are different). Would it be possible to change the name to datalabel?

Thanks, Scott

15 May 2002

The text labels can now be moved relative to the data markers. This makes it easier to read labels that might have been obscured by other data.

06 Jun 2003

Add telemetry keyword.

06 Jan 2010 1.1

Update copyright

18 Jun 2014 1.2

Removed mistaken attribution

27 Oct 2014 1.4

Made available as an easy-to-install Toolbox file.

27 Feb 2015 1.5

Cleaned up title

01 Sep 2016

Updated license

Contact us