help-octave
[Top][All Lists]
Advanced

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

Re: legend location 'outside' not working


From: Bob Lounsbury
Subject: Re: legend location 'outside' not working
Date: Mon, 13 Sep 2010 05:56:46 -0600



On Sun, Sep 12, 2010 at 7:05 PM, Ben Abbott <address@hidden> wrote:
On Sep 12, 2010, at 8:20 PM, Bob Lounsbury wrote:

> I've searched and searched and not found a clear answer, thought it would be better to email the pro's.
>
> Here's my issue ... In Octave 3.0.5:
>
> > plot(0:10)
> > legend('linear','location','eastoutside')
>
> works as expected with the legend to the outside of the plot.
>
> However, in Octave 3.2.3 the same code produces a legend inside the plot not outside. Has this been fixed in Octave 3.2.4? How do I get the legend to the outside of the plot area?
>
> Thanks,
> Bob

Version 3.2.3 moved closer to compatibility with Matlab. However, the behavior of the legend is an exception to that. The developers are currently working on this problem.

As a work around, you can modify the axis plotbox position by. For example ...

       x = 0:0.1:10;
       plot (x, sin (x), x, cos (x))
       set (gca, "position", get (0, "defaultaxesposition") + [0, 0, -1, 0] * 0.05)
       xlabel ("Angle, radians")
       ylabel ("Amplitude")
       legend ({"sin(x)", "cos(x)"}, "location", "eastoutside")

Ben


In Octave 3.2.3 the legend is still inside the plot with your example. See attached figure. Maybe this is a version issue. Do I need to try and compile the latest version?

Thanks,
Bob

Attachment: sincos.eps
Description: PostScript document


reply via email to

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