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:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating 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 Files:

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
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-17 rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2013-08-16 bpabbott StatusConfirmed => Ready For Test
        Operating SystemGNU/Linux => Any
    2013-01-03 rik5 StatusNone => Confirmed
    2012-12-04 rik5 Carbon-Copy- => Added -email is unavailable-
    2012-12-04 rik5 Item GroupNone => Regression
    2012-11-15 muhali Attached File- => Added foo.png, #26915

    Back to the top

    Powered by Savane 3.3