bugGNU Octave - Bugs: bug #55379, Legend...


bug #55379: Legend "northwestoutside" shrinks axes more than is required

Submitted by:  Dave Goel <deego>
Submitted on:  Fri 04 Jan 2019 08:03:48 AM UTC  
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  deego Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 04 Jan 2019 04:34:02 PM UTC, comment #2:

Confirmed.  The example can be simplified by using just a single plot.  See the example transcript below.

octave:6> plot ([1, 2])
octave:7> get (gca, 'position')
ans =

   0.13000   0.11000   0.77500   0.81500

octave:8> legend ("foo", "location", "northwestoutside")
octave:9> get (gca, 'position')
ans =

   0.14131   0.11000   0.68968   0.81500

octave:10> .775 - .14131
ans =  0.63369
octave:11> .775 - .13
ans =  0.64500
octave:12> .68968 - .14131
ans =  0.54837

As you can see, legend is not only shifting the axes position to the right to make room for the label "foo", but it is shrinking the width of the axes by more than is required.  I can restore the full size by expanding the width field of the axes "position" property back to what it should be.

octave:13> pos = get (gca, 'position')
pos =

   0.14131   0.11000   0.68968   0.81500

octave:14> pos(3) = (0.775 - (.14131 - 0.13))
pos =

   0.14131   0.11000   0.76369   0.81500

octave:15> set (gca, 'position', pos)

I'll check to see if this is an easy fix, but it might have to wait until the first bug fix release for the 5.0 branch.

Rik <rik5>
Project Administrator
Fri 04 Jan 2019 08:47:06 AM UTC, comment #1:

Yeah, I can confirm this with the qt toolkit in Octave 4.4 and 5. It does not occur with gnuplot.

Mike Miller <mtmiller>
Project Administrator
Fri 04 Jan 2019 08:03:48 AM UTC, original submission:

for ii=[3 2 1];
  plot([1 2]);
ii=1; legend('foo', 'location' , 'northwestoutside');

Here's a screenshot: http://i.imgur.com/EzdDGlo.png

Reporting per jwe's suggestion. This is with octave 4.2.2. Can anyone verify if this still exists in a later octave?

Dave Goel <deego>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by deego (Submitted the item)
  • -email is unavailable- added by deego

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-04 rik5 Item GroupNone => Feature Request
        Release4.2.2 => dev
        SummaryLegend "northwestoutside" reserves a large whitespace on the east coast! => Legend "northwestoutside" shrinks axes more than is required
    2019-01-04 mtmiller CategoryPlotting => Plotting with OpenGL
        StatusNone => Confirmed
    2019-01-04 deego Carbon-Copy- => Added deego3@gmail.com

    Back to the top

    Powered by Savane 3.4