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:
gplotmatrix( ) - legend positioning ?

Subject: gplotmatrix( ) - legend positioning ?

From: Bruno

Date: 12 Feb, 2009 12:23:01

Message: 1 of 3

Hello all,

considering the gplotmatrix funcion, for example:

gplotmatrix(r{ind}(:,[1 3]),r{ind}(:,4),r{ind}(:,2),[], ...
            '+o*.xsd^v><ph',20,'on','',{'l' 'd'}, 'score' );

(the parameters are not important in this case).

How could one control the position of the legend in the figure created
by gplotmatrix? I've tried using the handles (h, ax, bx), with no good
results.
It would be nice to set the legend in the 'NorthEastOutside' location,
but with respect the _whole picture_, not only one of the inner axes,
as it happens when dealing with the ax handle. With h and bx, a
'empty plot' warning is issued and nothing appears to happen.
Maybe some combination of get, set, gcf, gca could solve this, but
I still can't figure it out.

Thanks,

Bruno.

Subject: gplotmatrix( ) - legend positioning ?

From: us

Date: 12 Feb, 2009 12:32:02

Message: 2 of 3

"Bruno"
> gplotmatrix(r{ind}(:,[1 3]),r{ind}(:,4),r{ind}(:,2),[], ...
> '+o*.xsd^v><ph',20,'on','',{'l' 'd'}, 'score' );
> How could one control the position of the legend in the figure created
> by gplotmatrix...

a hint:

% do your GPLOTMATRIX(...)
% get the LEGEND handle
     lh=findall(gcf,'tag','legend');
% set its position,...
% set(lh,'position',...);
% -or-
% set(lh,'location',...);

us

Subject: gplotmatrix( ) - legend positioning ?

From: Bruno

Date: 12 Feb, 2009 12:47:01

Message: 3 of 3

It worked.

Thanks for your time.

Bruno.

"us " <us@neurol.unizh.ch> wrote in message <gn14s1$rmj$1@fred.mathworks.com>...
> "Bruno"
> > gplotmatrix(r{ind}(:,[1 3]),r{ind}(:,4),r{ind}(:,2),[], ...
> > '+o*.xsd^v><ph',20,'on','',{'l' 'd'}, 'score' );
> > How could one control the position of the legend in the figure created
> > by gplotmatrix...
>
> a hint:
>
> % do your GPLOTMATRIX(...)
> % get the LEGEND handle
> lh=findall(gcf,'tag','legend');
> % set its position,...
> % set(lh,'position',...);
> % -or-
> % set(lh,'location',...);
>
> us

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