lil labels the line according to legend if ~isnumeric(arg),myfigure(gcf);linelabel off,return,end else arg is figure number %NOTE: Interact with your plot after each call to linelabel s = sin(2*pi*linspace(0,1)')*(1:1:5); lh = plot(s); linelabel(lh) %Number with index. %Click on lines to label values. %Click and drag to move label %Right click to delete. linelabel off %Existing line labels are locked in place; can't add more linelabel(lh,11:15) %Provide your own numbers linelabel(lh,{'scott','writes','useful','MATLAB','utilities'}) %Provide your own custom labels legend({'Ch1','Ch2','Ch3','Ch4','Ch5'}) linelabel(lh,'legend') %Automatically use the labels from the legend.