bugGNU Octave - Bugs: bug #57262, legend incorrect after some of...

 
 

bug #57262: legend incorrect after some of plot objects have been deleted

Submitter:  Rik <rik5>
Submitted:  Mon 18 Nov 2019 11:20:38 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 09 Dec 2019 04:54:07 PM UTC, comment #3: 

Fixed by the same patch that resolved bug #57260.  Closing report.

Rik <rik5>
Group administrator
Mon 25 Nov 2019 06:47:37 PM UTC, comment #2: 

Yes, I already have a fix for this, but I would like to handle bug #57260 first since the lines you mention will probably be obsoleted.

Pantxo Diribarne <pantxo>
Group Member
Mon 25 Nov 2019 06:25:10 PM UTC, comment #1: 

If I had to guess, this is likely because the handle for the graphics object to the marker is not getting added to the variable hitem.  Either it should be added to hitem, or an hggroup should be created which contains the line object and marker object for the legend key so that only one handle needs to be communicated in hitem.

The code begins at line 942 in legend.m:


switch (typ)
  case "line"
    persistent lprops = {"color", "linestyle", "linewidth"};
    persistent mprops = {"color", "marker", "markeredgecolor", ...
                         "markerfacecolor", "markersize"};

    ## Main line
    vals = get (hplt, lprops);
    hitem = __go_line__ (hl, [lprops; vals]{:});

    ## Additional line for the marker
    vals = get (hplt, mprops);
    hmarker = __go_line__ (hl, "handlevisibility", "off", ...
                               "xdata", 0, "ydata", 0, [mprops; vals]{:});
    update_marker_cb (hmarker);

  case {"patch", "surface"}
    persistent pprops = {"edgecolor", "facecolor", "cdata", ...
                         "linestyle", "linewidth", ...
                         "marker", "markeredgecolor", ...
                         "markerfacecolor", "markersize"};

    vals = get (hplt, pprops);

    hitem = __go_patch__ (hl, [pprops; vals]{:});

endswitch

htxt = __go_text__ (hl, "string", str, [txtprops(:)'; txtvals(:)']{:});
set (base_hplt, "displayname", str);

addproperty ("peer_object", htxt, "double", base_hplt);
addproperty ("peer_object", hitem, "double", base_hplt);



Rik <rik5>
Group administrator
Mon 18 Nov 2019 11:20:38 PM UTC, original submission:  

Code to reproduce:


figure(1);
hold on;
h1 = plot(2,3,'r*');
h2 = plot(5,5,'bo');
legend('data 1','data 2');
pause (2)
delete(h1);


Originally the legend has two marker objects: a red '*' and a blue 'o'.  When graphic object h1 is deleted, the red '*' is moved up in the legend and appears inside the blue 'o'.


Rik <rik5>
Group administrator

 

(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 pantxo (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  • -email is unavailable- added by rik5
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-09 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2019-12-09 pantxo CategoryPlotting Plotting with OpenGL
    2019-11-18 rik5 Carbon-Copy- Added pantxo

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code