From: John on
Howdy!

Is there a way to put a title on the top of a legend? I want to make multiple legends for a plot and name them uniquely.
From: dpb on
John wrote:

> Howdy!
>
> Is there a way to put a title on the top of a legend? I want to make
> multiple legends for a plot and name them uniquely.

I suppose one could manage w/ quite a lot of fiddling about spacing and
so on as a legend is an axis object (identified as such internally w/ a
tag property to allow discernment from the other axes on the figure) but
it would seem tough. I'd suggest determining where and just use text()
as probably simpler...

Well, let's see what happens just for grins...

>> plot(rand(10,3))
>> legh = legend('a','b','c');
>> axes(legh)
>> title('Leg title')

Hmmmm....not _too_ bad; puts the title at URH corner w/ "Leg title"
above that's just outside the bounding axis box.

--
From: dpb on
dpb wrote:
> John wrote:
>
>> Howdy!
>>
>> Is there a way to put a title on the top of a legend? I want to make
>> multiple legends for a plot and name them uniquely.
>
> I suppose one could manage w/ quite a lot of fiddling about spacing and
> so on as a legend is an axis object (identified as such internally w/ a
> tag property to allow discernment from the other axes on the figure) but
> it would seem tough. I'd suggest determining where and just use text()
> as probably simpler...
>
> Well, let's see what happens just for grins...
>
> >> plot(rand(10,3))
> >> legh = legend('a','b','c');
> >> axes(legh)
> >> title('Leg title')
>
> Hmmmm....not _too_ bad; puts the title at URH corner w/ "Leg title"
> above that's just outside the bounding axis box.

OBTW, since this is a title attached to the legend axis, it does move
with the legend if moved manually which is an advantage over the text()
solution.

What it might take to dig into the guts of legend() to do more exotic
I've not clue--it's a sizable m-file, for sure....

Good luck...

--
From: us on
dpb <none(a)non.net> wrote in message <i1fo14$hmu$1(a)news.eternal-september.org>...
> John wrote:
>
> > Howdy!
> >
> > Is there a way to put a title on the top of a legend? I want to make
> > multiple legends for a plot and name them uniquely.
>
> I suppose one could manage w/ quite a lot of fiddling about spacing and
> so on as a legend is an axis object (identified as such internally w/ a
> tag property to allow discernment from the other axes on the figure) but
> it would seem tough. I'd suggest determining where and just use text()
> as probably simpler...
>
> Well, let's see what happens just for grins...
>
> >> plot(rand(10,3))
> >> legh = legend('a','b','c');
> >> axes(legh)
> >> title('Leg title')
>
> Hmmmm....not _too_ bad; puts the title at URH corner w/ "Leg title"
> above that's just outside the bounding axis box.
>
> --

duane, which ML ver do you have(?)...
ver 2010a requires this procedure

plot(rand(10,3));
lh=legend({'a','bb','ccc'},'location','southwest');
axes(lh);
title('not a legend title','fontweight','bold');
set(get(lh,'title'),'string','a legend','fontweight','bold');

us
From: dpb on
us wrote:
....

> duane, which ML ver do you have(?)...
> ver 2010a requires this procedure
>
> plot(rand(10,3));
> lh=legend({'a','bb','ccc'},'location','southwest');
> axes(lh);
> title('not a legend title','fontweight','bold');
> set(get(lh,'title'),'string','a legend','fontweight','bold');
>
> us

I'm still in dark ages w/ R12 (v6)... :( (That was about the time I
retired from active consulting)

What happens w/ lastest version w/ the the title() pointed at the legend
axis handle out of curiosity?

--
 |  Next  |  Last
Pages: 1 2 3
Prev: Skip lines in a for loop
Next: multiple legends