File Exchange

image thumbnail

datalabel

version 1.5.0.1 (7.34 KB) by

Interactive labeling of data points on a plot.

3 Downloads

Updated

View License

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).

Comments and Ratings (23)

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));

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

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.

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.

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!).

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?
Thanks

Juan Pedro

great

Akshay B

Awesome!! Thanks!

Engin Masazade

Very useful, thanks a lot

ma r

Thank you so much. This is perfect.

Elias Bwick

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

Zhichao Ruan

great job

Mo saggaf

Mo saggaf

Zahid Ullah Khan

Its Great... Thanks :-]

Keven Chang

Great Great Job.

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

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:).

Wong Yew Leong

Cool...just what we wanted!

Mujahid Sultan

Simply superb! great work.

YaYa Huang

You are an excellent guy!!

Luc Jonckheere

cool

Lina Chang

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

Josef Nauderer

Usefull tool!!!!

Updates

1.5.0.1

Updated license

1.5

Cleaned up title

1.4

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

1.2

Removed mistaken attribution

1.1

Update copyright

Add telemetry keyword.

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.

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

MATLAB Release
MATLAB 6.1 (R12.1)
Acknowledgements

Inspired: scattertext

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

» Watch video