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

 Submitter: deego Submitted: Fri 04 Jan 2019 08:03:48 AM UTC Category: Plotting with OpenGL Severity: 3 - Normal Priority: 5 - Normal Item Group: Feature Request Status: Fixed Assigned to: None Originator Name: deego Open/Closed:  * Closed Release:  * dev Operating System:  * GNU/Linux Fixed Release: None Planned Release: None
* Mandatory Fields

Add a New Comment Rich Markup

## Discussion

Mon 18 Nov 2019 08:55:22 PM UTC, comment #4:

Verified with new legend.m.  Marking as fixed and closing report.

Rik <rik5>
Mon 18 Nov 2019 09:49:13 AM UTC, comment #3:

legend.m has been rewritten (for OpenGL toolkits only). This bug should now be fixed.

Pantxo Diribarne <pantxo>
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>
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>
Fri 04 Jan 2019 08:03:48 AM UTC, original submission:

figure(1);
for ii=[3 2 1];
subplot(1,3,ii);
plot([1 2]);
endfor
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?

deego <deego>

## Attached Files

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

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

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

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only project members can vote.

## History

Date Changed by Updated Field Previous Value => Replaced by
2019-11-18 rik5 StatusReady For Test Fixed
Open/ClosedOpen Closed
2019-11-18 pantxo StatusConfirmed Ready For Test
2019-01-04 rik5 Item GroupNone Feature Request
Release4.2.2 dev
SummaryLegend &quot;northwestoutside&quot; 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 -email is unavailable-