Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to make a multi-column legend?

550 views
Skip to first unread message

junziyang

unread,
Sep 26, 2004, 9:17:40 PM9/26/04
to
I want to add legend to a figure with a lot of curves. With a
vertical legend, some of the curves will be hided by the legend,
while with a horizontal legend it is too long to fit in the figue.
My question is: Is there any way that can make the legend display in
a multi-row & multi-column manner? thanks!

junziyang

unread,
Sep 26, 2004, 9:18:29 PM9/26/04
to
I want to add legend to a figure with a lot of curves. With a
vertical legend, some of the curves will be hidden by the legend,

Ri

unread,
Sep 27, 2004, 5:11:21 AM9/27/04
to
Please try followings. Neither fulfill your request?

1:
legend('label 1','label 2',-1)

2:
L1=['label 1';'label. '];
L2=['label 2';'label. '];
legend(L1,L2)

Allan Yarbrough

unread,
May 21, 2010, 12:59:04 PM5/21/10
to
I attempted both of these to make a 3x3 legend, without success. This is an old thread; has anyone solved the problem?

Ri <r...@ozono.pe.u-tokyo.ac.jp> wrote in message <eeeb...@webx.raydaftYaTP>...

Adrian Cherry

unread,
May 26, 2010, 5:46:03 AM5/26/10
to
"Allan Yarbrough" <awy...@afit.edu> wrote in message <ht6e4o$dv1$1...@fred.mathworks.com>...

> I attempted both of these to make a 3x3 legend, without success.
> This is an old thread; has anyone solved the problem?

I believe I may have a solution - I'm just testing my routine at the moment which allows multicolumn or multirow legends. I'm just massaging into a format suitable for the file exchange.

Adrian

Celine Cluzel

unread,
Nov 2, 2010, 6:45:05 AM11/2/10
to
"Adrian Cherry" <adrian...@baesystems.com> wrote in message <htiqkr$m0v$1...@fred.mathworks.com>...

Hi Adrian,
If you have found the solution, I would be interested too, thank you!

Celine

Adrian Cherry

unread,
Nov 2, 2010, 1:09:04 PM11/2/10
to
"Celine Cluzel" <celine...@element-energy.co.uk> wrote in message <iaoq3h$fi4$1...@fred.mathworks.com>...

> Hi Adrian,
> If you have found the solution, I would be interested too, thank you!
>
> Celine

Hi, thanks for prompting me about this. I'd neglected it because I had a problem with the printpreview and export function redrawing the legend and messing it all up. So thanks to "undocumented matlab" I finally got it sorted.

gridLegend is now available on file exchange. http://www.mathworks.com/matlabcentral/fileexchange/29248-gridlegend-a-multi-column-format-for-legends

I've included a demo file to show how it can be used and please let me know if it helps.

Regards

Adrian Cherry

0 new messages