5.0

5.0 | 1 rating Rate this file 19 downloads (last 30 days) File Size: 3.04 KB File ID: #11234

labelplot

by Will Robertson

 

31 May 2006 (Updated 22 Jun 2009)

Code covered by the BSD License  

Adds plot legend based on 'Tag'

Download Now | Watch this File

File Information
Description

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
  legend('Positive','Negative')
and adding a text box 'Slope' above it.

MATLAB release MATLAB 7.2 (R2006a)
Zip File Content  
Other Files labelplot.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
06 Apr 2007 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!

Please login to add a comment or rating.
Updates
22 Jun 2009

Add BSD licence.

Tag Activity for this File
Tag Applied By Date/Time
annotation Will Robertson 22 Oct 2008 08:27:17
customization Will Robertson 22 Oct 2008 08:27:17
legend Will Robertson 22 Oct 2008 08:27:17
label Will Robertson 22 Oct 2008 08:27:17
plot Will Robertson 22 Oct 2008 08:27:17
tag Will Robertson 22 Oct 2008 08:27:17
graphics Will Robertson 22 Oct 2008 08:27:17
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com