bugGNU Octave - Bugs: bug #35321, invalid handle for legend after...

 
 

bug #35321: invalid handle for legend after using plotyy

Submitter:  None
Submitted:  Tue 17 Jan 2012 02:58:20 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Paul Stansell Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.4.3
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 17 Oct 2013 08:20:18 PM UTC, comment #3: 

Fixed on the development branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/c14e5af64de4).  This will be a part of the 3.8 release due very soon.

Rik <rik5>
Group administrator
Thu 26 Jan 2012 02:11:46 PM UTC, comment #2: 

Debugging indicates the 1st axes is deleted during the call to gh_manager::lookup (val) below. This code snippet is from graphics.cc:__go_axes_init__().


 8980           if (h.ok ())
 8981             {
 8982               graphics_object obj = gh_manager::get_object (h);
 8983
 8984               obj.set_defaults (mode);
 8985
 8986               h = gh_manager::lookup (val);
 8987               if (! h.ok ())
 8988                 error ("__go_axes_init__: axis deleted during initialization (= %g)", val);
 8989             }
 8990           else
 8991             error ("__go_axes_init__: invalid graphics object (= %g)", val);
 8992         }


I took a quick glance at gh_manager::lookup(val). My impression is that lookup calls do_lookup and the problem occurs later, but My lack of c++ experience limits my insight. I think I'm at a dead end.

Anyone else?

Ben Abbott <bpabbott>
Group Member
Thu 26 Jan 2012 02:04:58 AM UTC, comment #1: 

I did some isolating. It appears that the 1st plotyy axes object is being deleted by a call to _go_axes_init_(ax(2)), which is a built-in function.

Running the script below,


close all
clear all
x = 0:0.1:10;
y = sin (x);
ax = plotyy (x, y, x-1, y+1);
set (ax(1), "deletefcn", @(x,y) disp("*** Deleting 1st plotyy axes ***"));
__go_axes_init__ (ax(2))


Initializing ax(2) results in ax(1) being deleted.


*** Deleting 1st plotyy axes ***
error: invalid conversion from real matrix to real scalar
error: __calc_dimensions__: expecting graphics handle as only argument
error: called from:
error:   /Users/bpabbott/Development/mercurial/default/scripts/plot/private/__go_draw_axes__.m at line 55, column 8
error:   /Users/bpabbott/Development/mercurial/default/scripts/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /Users/bpabbott/Development/mercurial/default/scripts/plot/__gnuplot_drawnow__.m at line 86, column 5


I'll have to rebuild with optimization off to make it easier to debug what is happening. I'll report back later.

Ben Abbott <bpabbott>
Group Member
Tue 17 Jan 2012 02:58:20 PM UTC, original submission:  

The following code gives and error in Octave-3.4.3 but works in Octave-3.2.3:


x = linspace(0,2*pi,100);
y = sin(x);

ax = plotyy (x, y, x-1, y+1);

plot(x,y,x,cos(x));
legend('sin','cos');


The error occurs after the last call to legend and no legend is drawn.  The error is:


error: get: invalid handle (= -31.1477)
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: invalid empty index list
error: called from:
error:   /usr/local/share/octave/3.4.3/m/plot/legend.m at line 136, column 47


Anonymous

 

(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 bpabbott (Posted a comment)
  • -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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-17 rik5 Item GroupNone Regression
        StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2012-01-26 bpabbott StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code