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 15 Nov 2012 10:20:21 AM UTC  
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 Markup)

You are not logged in

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


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

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

Rik <rik5>
Project Administrator
Fri 16 Aug 2013 09:13:33 PM UTC, 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 04 Dec 2012 06:55:20 PM UTC, 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 04 Dec 2012 05:48:40 AM UTC, 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 15 Nov 2012 10:20:21 AM UTC, 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 (41KiB - 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 17 Aug 2013 01:11:41 AM UTCrik5StatusReady For Test=>Fixed
    Fri 16 Aug 2013 09:13:33 PM UTCbpabbottStatusConfirmed=>Ready For Test
      Operating SystemGNU/Linux=>Any
    Thu 03 Jan 2013 04:34:46 AM UTCrik5StatusNone=>Confirmed
    Tue 04 Dec 2012 06:55:20 PM UTCrik5Carbon-Copy-=>Added -unavailable-
    Tue 04 Dec 2012 05:48:40 AM UTCrik5Item GroupNone=>Regression
    Thu 15 Nov 2012 10:20:21 AM UTCmuhaliAttached File-=>Added foo.png, #26915

    Back to the top

    Powered by Savane 3.1-cleanup1