bugGNU Octave - Bugs: bug #55800, legend ignores location when not...

 
 

bug #55800: legend ignores location when not last positional argument

Submitter:  Muhali <muhali>
Submitted:  Fri 01 Mar 2019 10:12:42 AM UTC
   
 
Category:  Plotting Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 02 Mar 2019 07:14:33 PM UTC, comment #3: 

Okay, I made a change on the development branch to accept "location" in any position.  See https://hg.savannah.gnu.org/hgweb/octave/rev/45270d3aa861.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Sat 02 Mar 2019 06:31:20 PM UTC, comment #2: 

I had checked these examples in the Matlab online tool, it does allow 'location' to appear in any positional argument, it does not have to be the last.

Mike Miller <mtmiller>
Group Member
Sat 02 Mar 2019 06:05:00 PM UTC, comment #1: 

Can you check how Matlab handles this?

See the documentation at https://www.mathworks.com/help/matlab/ref/legend.html.  According to the help text there,


legend(___,'Location',lcn) sets the legend location. For example, 'Location','northeast' positions the legend in the upper right corner of the axes. Specify the location after other input arguments.


which indicates that the 'Location' argument needs to be the last one.

Of course, Octave likes to think of itself as a superset of Matlab and it might be nice to be able to accept options in any order.  But I don't think this will affect any users who are transitioning Matlab code to Octave.

Rik <rik5>
Group administrator
Fri 01 Mar 2019 10:12:42 AM UTC, original submission:  

The following example


subplot(2,1,1) ;
plot(randn(2,1)) ;
legend({"A"}, "location", "northwest", "box", "off") ;
subplot(2,1,2) ;
plot(randn(2,1)) ;
legend({"A"}, "box", "off", "location", "northwest") ;


shows that the location parameter is ignored if it is not the last one.

Muhali <muhali>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-02 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2019-03-02 mtmiller StatusNeed Info Confirmed
    2019-03-02 rik5 StatusConfirmed Need Info
    2019-03-01 mtmiller Severity3 - Normal 2 - Minor
        Item GroupNone Incorrect Result
        StatusNone Confirmed
        Summarylegend ignores location legend ignores location when not last positional argument

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code