bugGNU Octave - Bugs: bug #42035, legend (hax, ...) doesn't work for...

 
 

bug #42035: legend (hax, ...) doesn't work for any axes handle apart from gca

Submitter:  sergey plotnikov <nul0m>
Submitted:  Thu 03 Apr 2014 09:27:16 AM UTC
   
 
Category:  Plotting 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
   

Sun 13 Apr 2014 05:41:43 AM UTC, comment #5: 

Checked in a changeset that fixes the problem (http://hg.savannah.gnu.org/hgweb/octave/rev/ce36233e4849).  I used the same save/restore figure code that is used in the other plotting routines.  I added the fix to updateline and the %!test from Pantxo's changeset.

Rik <rik5>
Group administrator
Sun 06 Apr 2014 04:17:36 PM UTC, comment #4: 

The attached updated patch fixes the infinite loop problem in the case you have shown but as you also showed I may be overlooking many difficulties.

(file #31131)

Pantxo Diribarne <pantxo>
Group Member
Sun 06 Apr 2014 03:04:21 PM UTC, comment #3: 

legend.m is really complicated which always makes it painful to modify.  In this case, the patch works for the first invocation, but not for a second invocation.  In fact, it enters into an infinite loop.


close all;
figure;
a1 = axes;
plot (a1, 1:10, sin (1:10));
figure;
a2 = axes;
plot (a2, 1:10, sin (1:10));
legend(a1,'a1');
legend(a1,'new text');


The trouble appears to be with a callback for setting "DisplayName" when the text changes which then re-invokes legend.

Rik <rik5>
Group administrator
Fri 04 Apr 2014 10:19:10 AM UTC, comment #2: 

yeah, I was about to do the same thing, thank you Pantxo! will try it out

sergey plotnikov <nul0m>
Thu 03 Apr 2014 03:40:11 PM UTC, comment #1: 

I attached a patch for this bug.

(file #31116)

Pantxo Diribarne <pantxo>
Group Member
Thu 03 Apr 2014 09:27:16 AM UTC, original submission:  

In case of fltk legend is created at current axes instead of ones which was specified. And in case of gnuplot it is not shown at all.


close all;
figure;
a1 = axes;
plot (a1, 1:10, sin (1:10));
figure;
a2 = axes;
plot (a2, 1:10, sin (1:10));
legend(a1,'a1');


sergey plotnikov <nul0m>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31131:  legend_parent_bug42035.patch added by pantxo (5KiB - application/x-download)
file #31116:  legend_ax_arg.patch added by pantxo (4KiB - text/x-diff)

 

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 mtmiller (Updated the item)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by nul0m (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
    2014-04-13 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-04-06 pantxo Attached File- Added legend_parent_bug42035.patch, #31131
    2014-04-03 mtmiller StatusNone Patch Submitted
        Operating SystemGNU/Linux Any
    2014-04-03 pantxo Attached File- Added legend_ax_arg.patch, #31116

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code