Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Two lined legend entry

Subject: Two lined legend entry

From: Bruce

Date: 2 Jan, 2009 22:53:02

Message: 1 of 2

Does anyone know how to make one legend entry have two lines of text (rather than one very long line)?

Thanks
Bruce

Subject: Two lined legend entry

From: Jiro Doke

Date: 3 Jan, 2009 01:34:02

Message: 2 of 2

"Bruce " <brucebassi@yahoo.com> wrote in message <gjm5se$ios$1@fred.mathworks.com>...
> Does anyone know how to make one legend entry have two lines of text (rather than one very long line)?
>
> Thanks
> Bruce

You can use SPRINTF:

>> plot(rand(10,2))
>> legend(sprintf('this has\ntwo lines'), 'this is one line')

jiro

Tags for this Thread

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.

Contact us