bugGNU Octave - Bugs: bug #37746, 'legend right' squeezes figure to...


bug #37746: 'legend right' squeezes figure to the left (using 'eastoutside')

Submitted by:  Muhali <muhali>
Submitted on:  Thu Nov 15 10:20:21 2012  
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Sat Aug 17 01:11:41 2013, comment #4:

I just verified that the behavior has been fixed; Closing report.

Rik <rik5>
Project Administrator
Fri Aug 16 21:13:33 2013, comment #3:

This is working for me with both the gnuplot and fltk toolkits. There have been changes to both legend() and graphics.cc since the last comment, but I don't have any insight into which change fixed this.

In any event, I'm marking this as "ready for test". If there are no reported problems it can be marked "fixed" and closed.

Ben Abbott <bpabbott>
Project Member
Tue Dec 4 18:55:20 2012, comment #2:

I'm going to add Ben to the CC list since he is more of an expert on this piece of code.

The problem seems to be in the large switch statement on position.

When the legend does not exist, ca_pos and ca_outpos variables work correctly in the equations to resize the current axis to accomodate the legend being placed on the outside. When the legend already exists, however, the accomodation has already been made but these equations don't take that into account. Instead they shrink the current axis again. In fact, there is some recursive updating taking place that I'm not sure is desired. If I set a breakpoint on the line then it gets executed 3 times for a single call to "legend right". This seems like overkill.

Rik <rik5>
Project Administrator
Tue Dec 4 05:48:40 2012, comment #1:

Confirmed on a development tip (12/3/12). Worse, this is a regression from 3.6.3 which did work correctly.

A simpler piece of code to demonstrate the problem is:

The problem is with the "outside" portion. If I just use a location of "east" then things work as expected.

Rik <rik5>
Project Administrator
Thu Nov 15 10:20:21 2012, original submission:

Executing this code, where only 'legend right' is added in the 2nd plot,

squeezes the entire figure too much to the left. The figure is attached.

Muhali <muhali>


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

Attach File(s):

Attached Files
file #26915:  foo.png added by muhali (41kB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by rik5
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)

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

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Aug 17 01:11:41 2013rik5StatusReady For Test=>Fixed
    Fri Aug 16 21:13:33 2013bpabbottStatusConfirmed=>Ready For Test
      Operating SystemGNU/Linux=>Any
    Thu Jan 3 04:34:46 2013rik5StatusNone=>Confirmed
    Tue Dec 4 18:55:20 2012rik5Carbon-Copy-=>Added -unavailable-
    Tue Dec 4 05:48:40 2012rik5Item GroupNone=>Regression
    Thu Nov 15 10:20:21 2012muhaliAttached File-=>Added foo.png, #26915

    Back to the top

    Powered by Savane 3.1-cleanup1