Thread Subject: tugning off legend entries

Subject: tugning off legend entries

From: Juliette Salexa

Date: 21 Jun, 2009 03:19:01

Message: 1 of 4

Hello, I only want 2 of my 4 curves to actually have legend entries (ie, I want a legen that only has 2 entries in it), how do I remove the unwanted two ??

Subject: tugning off legend entries

From: TideMan

Date: 21 Jun, 2009 03:39:59

Message: 2 of 4

On Jun 21, 3:19 pm, "Juliette Salexa" <juliette.physic...@gmail.com>
wrote:
> Hello, I only want 2 of my 4 curves to actually have legend entries (ie, I want a legen that only has 2 entries in it), how do I remove the unwanted two ??

Rather than turning them off, only include the ones you want:
hold on
h1=plot(t,x1);
h2=plot(t,x2);
h3=plot(t,x3);
h4=plot(t,x4);
hold off
legend([h2 h4],'Second','Fourth')

Subject: tugning off legend entries

From: Juliette Salexa

Date: 21 Jun, 2009 06:09:02

Message: 3 of 4

Perfect! Thanks!

Subject: tugning off legend entries

From: jacob mcdermott

Date: 10 Aug, 2009 22:23:04

Message: 4 of 4

TideMan <mulgor@gmail.com> wrote in message <dc2eee64-a46f-41fb-aebf-da9acfc7c612@j9g2000prh.googlegroups.com>...
> On Jun 21, 3:19?pm, "Juliette Salexa" <juliette.physic...@gmail.com>
> wrote:
> > Hello, I only want 2 of my 4 curves to actually have legend entries (ie, I want a legen that only has 2 entries in it), how do I remove the unwanted two ??
>
> Rather than turning them off, only include the ones you want:
> hold on
> h1=plot(t,x1);
> h2=plot(t,x2);
> h3=plot(t,x3);
> h4=plot(t,x4);
> hold off
> legend([h2 h4],'Second','Fourth')

Is there an alternate format for this? I have a contour plot that also has three curves.

because I include the code:
[W H] = meshgrid(40:10:120, 140:10:190);
the above does not work

I get the error
??? Operands to the || and && operators must be convertible to logical
scalar values.

Error in ==> legend at 200
    elseif narg > 0 && ~ischar(varargin{1}) && ...

any help?

Tags for this Thread

Everyone's Tags:

legend(2)

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.

Tag Activity for This Thread
Tag Applied By Date/Time
legend jacob mcdermott 10 Aug, 2009 18:24:05
legend Sprinceana 21 Jun, 2009 03:25:22
rssFeed for this Thread

Contact us at files@mathworks.com