bugGNU Octave - Bugs: bug #55508, legend placed at incorrect...

 
 

bug #55508: legend placed at incorrect location with subplots

Submitter:  Trace Baker <mtn_trace>
Submitted:  Fri 18 Jan 2019 03:58:12 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Duplicate Assigned to:  None
Originator Name:  mtn_trace Open/Closed:  * Closed
Release:  * 4.4.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 18 Jan 2019 04:32:23 PM UTC, comment #1: 

Thanks for your report. This is a known issue (see task #14243 and references therein) so I'll close this report as a duplicate of bug #39697.

The workaround is generally to add legends (and eventually colorbars) only once all axes have been drawn


figure
hax1 = subplot (2,1,1)
plot (1:10)
title TITLE
hax2 = subplot (2,1,2)
plot (1:10)
title TITLE

legend (hax1, "1st plot")
legend (hax2, "2nd plot")


Pantxo Diribarne <pantxo>
Group Member
Fri 18 Jan 2019 03:58:12 PM UTC, original submission:  

Plotting two subplots, one above the other, in a figure. Adding a legend to both, with the location set to “northwest” or “northeast.” The legend on the upper plot is at the correct x position, but centered on the plot’s upper border in y. The legend on the lower plot is in the expected location.

The legend position is correct when subplots are arranged side-by-side. Did not try other arrangements or location parameters.

The workaround is to make the plot, then move the top legend to the expected position with get and set position commands.

The environment is Octave: 4.4.0, graphics toolkit: qt, Mac OS X ProductVersion: 10.14.2, BuildVersion: 18C54.

Attached code producing the effect is legendloc.m; screenshot with annotations is legendloc.jpg.

Trace Baker <mtn_trace>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #46009:  legendloc.m added by mtn_trace (1KiB - application/octet-stream)
file #46010:  legendloc.jpg added by mtn_trace (107KiB - image/jpeg)

 

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 mtn_trace (Submitted the item)
  • -email is unavailable- added by mtn_trace
  •  

    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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-18 pantxo CategoryPlotting Plotting with OpenGL
        StatusNone Duplicate
        Open/ClosedOpen Closed
    2019-01-18 mtn_trace Attached File- Added legendloc.m, #46009
        Attached File- Added legendloc.jpg, #46010
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code