Thread Subject: adding a legend?

Subject: adding a legend?

From: Samoline1 Linke

Date: 9 Feb, 2010 17:53:03

Message: 1 of 3

I have selected two variabels from workspace, right clicked and drew them.

What is the command now to add their legend but without writing the names. As an example you can do click Insert --> Legend and you get automatically legend showing the names of the drawn variables.

I want the command for the same action so that I could use it in .mfile.

Subject: adding a legend?

From: Alan B

Date: 9 Feb, 2010 19:20:23

Message: 2 of 3

"Samoline1 Linke" <maganatewoman@yahoo.com> wrote in message <hks7dv$hp5$1@fred.mathworks.com>...
> I have selected two variabels from workspace, right clicked and drew them.
>
> What is the command now to add their legend but without writing the names. As an example you can do click Insert --> Legend and you get automatically legend showing the names of the drawn variables.
>
> I want the command for the same action so that I could use it in .mfile.

The command is legend.

Subject: adding a legend?

From: Bc

Date: 9 Feb, 2010 20:34:05

Message: 3 of 3

x = 0:.2:12;
        plot(x,bessel(1,x),x,bessel(2,x),x,bessel(3,x));
        legend('First','Second','Third');
        legend('First','Second','Third','Location','NorthEastOutside')

Notice legend parts correspond to what you are plotting in the order you plotted them.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com