bugGNU Octave - Bugs: bug #67713, legend eastoutside resizes subplot

 
 

bug #67713: legend eastoutside resizes subplot

Submitter:  None
Submitted:  Mon 17 Nov 2025 12:15:31 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  MarcC Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 10.2.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Tue 18 Nov 2025 10:29:53 AM UTC, comment #2: 

I'm attaching .png files with the results of the commands from comment #1 in MATLAB R2025b and Octave 10.3.0.

Apparently, MATLAB only rescales the axes with the legend and leaves the other ones as they were.
(Additionally, there seems to be some other scaling going on. But that might be unrelated to this report.)


Markus Mützel <mmuetzel>
Group administrator
Mon 17 Nov 2025 03:55:06 PM UTC, comment #1: 

This way plots stay aligned vertically. Does Matlab behave differently? E.g how does Matlab handle the following script?


subplot(2,2,1); plot (rand (1,10));
subplot(2,2,2); plot (rand (1,10));
subplot(2,2,3); plot (rand (1,10)); legend ("This is a text", "location", "eastoutside")
subplot(2,2,4); plot (rand (1,10));



Pantxo Diribarne <pantxo>
Group Member
Mon 17 Nov 2025 12:15:31 PM UTC, original submission:  

GNU Octave Version: 10.2.0 (hg id: 8d42ee70e124)
Operating System: MINGW32_NT-6.2 Windows 6.2  x86_64
Software rendering enabled

If I add a legend to a subplot, sometimes the previous axis is also resized it the legend location is "eastoutside".

Please see this example, both images attached.


subplot (2, 2, 2)
plot (rand (15, 2))
subplot (2, 2, 3)
plot (rand (15, 3))
imwrite (frame2im (getframe(gcf)), "before_legend.png");
legend ({"foo lorem ipsum dolor", "bar", "baz"}, "location", "eastoutside")
imwrite (frame2im (getframe(gcf)), "after_legend.png");


Anonymous

 

Attached Files

Attached Files
file #57810:  before_legend.png added by None (120KiB - image/png)
file #57811:  after_legend.png added by None (114KiB - image/png)

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by pantxo (Posted a comment)
  •  

    Votes

    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 group members can vote.

     

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

    History

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-11-18 mmuetzel Attached File- Added bug67713-MATLAB-R2025b.png, #57821
        Attached File- Added bug67713-Octave-10-3-0.png, #57822
    2025-11-17 pantxo Operating SystemMicrosoft Windows Any
    2025-11-17 None Attached File- Added before_legend.png, #57810
        Attached File- Added after_legend.png, #57811

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code