bugGNU Octave - Bugs: bug #50497, plotyy() legend in reverse order

 
 

bug #50497: plotyy() legend in reverse order

Submitter:  Ray Zimmerman <rdzman>
Submitted:  Wed 08 Mar 2017 07:29:29 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Ray Zimmerman Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 18 Nov 2019 11:27:48 PM UTC, comment #6: 

Fixed again.  Closing report.

Rik <rik5>
Group administrator
Mon 18 Nov 2019 10:51:20 PM UTC, comment #5: 
Pantxo Diribarne <pantxo>
Group Member
Mon 18 Nov 2019 09:50:21 PM UTC, comment #4: 

This bug has returned with the new legend code for version 6.1.

Rik <rik5>
Group administrator
Thu 09 Mar 2017 05:23:40 AM UTC, comment #3: 

@Pantxo: Go ahead and push this to stable.

Rik <rik5>
Group administrator
Wed 08 Mar 2017 10:50:35 PM UTC, comment #2: 

I attached a simple fix for the order of legend item. The color order handling (green expected for the second axes) is probably to be found in plotyy it self.


(file #39951)

Pantxo Diribarne <pantxo>
Group Member
Wed 08 Mar 2017 07:32:18 PM UTC, comment #1: 

I meant to add that this seems potentially related to bug #46835

Ray Zimmerman <rdzman>
Wed 08 Mar 2017 07:29:29 PM UTC, original submission:  

When using plotyy(), the legend assigns the wrong labels to the data series, in particular, they are in the reverse order, with the first label being assigned to the last data series, etc.

The following plots illustrate the problem ...

figure
plot([1;2], [1 2 3 4; 2 3 4 5]);
legend('One', 'Two', 'Three', 'Four')

figure
plotyy([1;2], [1 2 3 4; 2 3 4 5], [1;2], [-1; -5]);
legend('One', 'Two', 'Three', 'Four')


In Matlab, the second plot will look like the first (except for the additional line on the secondary axis) and the legend will also be identical. In Octave, the legend labels all 4 lines incorrectly (reverse order), and incidentally, also uses a different color (red) from that used by Matlab (green).

Ray Zimmerman <rdzman>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39951:  plotyy_order.patch added by pantxo (772B - text/x-patch)
file #39946:  Octave-plot.pdf added by rdzman (3KiB - application/pdf - Plots created with Octave 4.2.0, Matlab R2016a on Windows 7.)
file #39947:  Matlab-plot.pdf added by rdzman (2KiB - application/pdf - Plots created with Octave 4.2.0, Matlab R2016a on Windows 7.)
file #39948:  Octave-plotyy.pdf added by rdzman (3KiB - application/pdf - Plots created with Octave 4.2.0, Matlab R2016a on Windows 7.)
file #39949:  Matlab-plotyy.pdf added by rdzman (2KiB - application/pdf - Plots created with Octave 4.2.0, Matlab R2016a on Windows 7.)

 

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 pantxo (Updated the item)
  • -email is unavailable- added by rdzman (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 16 latest changes.

    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-11-18 rik5 Item GroupIncorrect Result Regression
        StatusFixed Confirmed
        Open/ClosedClosed Open
        Release4.2.0 dev
    2017-03-09 rik5 StatusPatch Reviewed Fixed
        Open/ClosedOpen Closed
    2017-03-09 rik5 StatusPatch Submitted Patch Reviewed
    2017-03-08 pantxo Attached File- Added plotyy_order.patch, #39951
        StatusNone Patch Submitted
    2017-03-08 rdzman Attached File- Added Octave-plot.pdf, #39946
        Attached File- Added Matlab-plot.pdf, #39947
        Attached File- Added Octave-plotyy.pdf, #39948
        Attached File- Added Matlab-plotyy.pdf, #39949

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code