help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subplot and Legend


From: Juan Pablo Carbajal
Subject: Re: Subplot and Legend
Date: Wed, 18 Apr 2012 14:31:35 +0200

On Wed, Apr 18, 2012 at 1:02 PM, Ismael Núñez-Riboni <address@hidden> wrote:
>> I have been trying to make one legend for a set of subplots.
>> The function legend creates a legend hose position is fixed to the
>> current axes. Therefore I tried creating an additional axis that cover
>> the whole figure and add the subplots inside.
>> It doesn't work cause the legend's contents are also connected to the
>> axes.
>
>
> I unterstand you want a single legend for various subplots. You can start by
> choosing in which subplot you want the legend to be with a simple "if
> statement":
>
> subplot(N,R,k)
>
> if k == thisone
>   legend(...)
> end
>
>
>> Is there anyway to move freely the legend inside the figure
>> (independent of the axis created by subplot)?
>
>
> So far I know, like in the matlab plots and with the mouse: no.
>
>
>> Is it possible to resize the box containing the legend? (in case
>> 'otientation' 'horizontal' and subplots, the legend can use several
>> lines, which in a whole figure context wouldn't be necessary)
>
>
> You can give the orientation and location of the legend. Did you check
> already: "help legend"? :-) I think what you want is the option "outside"...
>
> Saludos y Gruesse, Ismael.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

Hi,
I may have nit been clear enough. You could use th eif solution, but:
1. The subplot wit the legend is reshaped
2. The legend is formatted to the size of that particular subplot. So
it doesn't look like a global legend.

What I am trying to do is a more low level solution. So create a axes
that covers the whole figure, plot there, create a legend
(northouside, horizontal) and then try to make the big axes invisible,
so one sees only the legend. The do all the subplots. I could mak
ethis work.

The other option I was exploring is to create a second figure with a
legend and then "copy" the legend to the figure with the subplots.
Though there is a delete method for graphical objects, I can't figure
out how to do a "add" method. that is change the parents and the
childs of the legend.

Hope this makes it more clear

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]