File Exchange

image thumbnail


version (4.33 KB) by Michelle Hirsch
Label lines in a plot by clicking on them. Nice and simple.

1 Download

Updated 26 Nov 2019

From GitHub

View Version History

View license on GitHub

Did you ever plot a whole bunch of lines and then have trouble telling them apart? You find that a static legend isn't convenient, or just doesn't suffice? Well, with linelabel, simply click on a line and it's identity will be revealed!

Cite As

Michelle Hirsch (2021). linelabel (, GitHub. Retrieved .

Comments and Ratings (8)


Chang hsiung

exactly what I have been looking for

Adrian Cherry

Very useful.

I tweaked it slightly so that it would work with bar charts as well (R2008a)

lines 131 and 182 now read
if strcmp(htype,'line') || strcmp(htype,'hggroup')



Maurizio Santoro

Very good!

Andres Mahecha-Botero


Antonin Garriga

very good idea

Ju wang

very nice!

Ju wang

very nice!

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!