File Exchange

image thumbnail


version 1.1 (3.04 KB) by

Adds plot legend based on 'Tag'

1 Download


View License

This short function will generate a legend based on 'Tag' information given by plot. A legend title is also possible.

figure; hold on; x = 1:10; plot(x,x,'Tag','Positive'); plot(x,-x,'Tag','Negative'); labelplot('eo','v','Slope');

The above example is equivalent to
and adding a text box 'Slope' above it.

Comments and Ratings (1)

Qi Pan

Fantastic - just what I was looking for! Generates perfect legends which does not require me to specify a fixed number of plot lines! Thanks!



Add BSD licence.

MATLAB Release
MATLAB 7.2 (R2006a)

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

» Watch video