bugGNU Octave - Bugs: bug #61526, legend() messes up line styles...

 
 

bug #61526: legend() messes up line styles when handed specific line handles as input

Submitter:  None
Submitted:  Tue 23 Nov 2021 06:16:23 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 6.3.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Jan 2022 09:51:10 PM UTC, comment #3: 

Closing report as fixed.

Pantxo Diribarne <pantxo>
Group Member
Tue 23 Nov 2021 09:44:41 PM UTC, comment #2: 

I pushed a change on default (which will become Octave 7 soon):

http://hg.savannah.gnu.org/hgweb/octave/rev/ccc991d563ce

I tested with the following simpler example:


clf;
h = plot (1:10, 1:10, "xb", 1:10, (1:10)+1, "-r");
legend ();
legend (h(2));


Marking ready for test.

Pantxo Diribarne <pantxo>
Group Member
Tue 23 Nov 2021 10:20:50 AM UTC, comment #1: 

I can confirm the issue. Reproducing the example verbatim and attaching the result:


f = figure;
ax = axes(f);
h = plot(ax,rand(5,1),rand(5,2));
legend(ax);
set(h(1),'linestyle','none','marker','x')
set(h(1),'ydata',nan(5,1))
%legend(ax,'off')
legend(ax,h(2))




Pantxo Diribarne <pantxo>
Group Member
Tue 23 Nov 2021 06:16:23 AM UTC, original submission:  

Hi,
as the title says, the legend function messes up the line styles/markers when only a subset of line handles are handed over to the function. I've attached a minimal example where you can see that "data2" suddenly got an x-marker. A workaround is to set the legend to off and redraw it.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #52328:  buglegend.png added by pantxo (18KiB - image/png)
file #52327:  legend_bug.m added by None (174B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by None (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-14 pantxo StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-11-23 pantxo StatusConfirmed Ready For Test
    2021-11-23 pantxo Attached File- Added buglegend.png, #52328
        StatusNone Confirmed
    2021-11-23 None Attached File- Added legend_bug.m, #52327

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code