bugGNU Octave - Bugs: bug #39321, legend listener interferes with...

 
 

bug #39321: legend listener interferes with print()

Submitter:  Ben Abbott <bpabbott>
Submitted:  Sat 22 Jun 2013 06:38:24 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 28 Jul 2013 07:45:03 PM UTC, comment #4: 

No problems reported. I'm closing this report.

(note: imo, legend() is in need of a a rewrite)

Ben Abbott <bpabbott>
Group Member
Fri 28 Jun 2013 03:38:27 PM UTC, comment #3: 

Stephan/others, the fontsize problem is due to the legend() function deleting its existing legend objects and recreating them when the legend's properties are modified and the legend is updated.

I think I can produce a clumsy fix.

Suggestions for a more proper fix would be appreciated.

Ben Abbott <bpabbott>
Group Member
Fri 28 Jun 2013 03:12:33 PM UTC, comment #2: 

Since changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/5cf7369a74cb
I get an error when changing font for printing:


> plot(1:2); legend('x'); print('test.png','-FHelvetica:20');
> plot(1:2); legend('x'); print('test.png','-FHelvetica:20');
error: set: invalid handle (= -17.8048)
error: called from:
error:   /usr/share/octave/3.7.5/m/plot/print.m at line 410, column 9



Stefan Mahr <dac922>
Sat 22 Jun 2013 08:59:15 AM UTC, comment #1: 

I pushed a changeset

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

Rewriting legend's updater to resolve this bug would be problematic as we'd have to provide different methods to update when the number of children change.  So, I've filtered out the text object children of the legend.

Ben Abbott <bpabbott>
Group Member
Sat 22 Jun 2013 06:38:24 AM UTC, original submission:  

The print() command temporarily modifies all fontsizes.  When a legend's "fontsize" property is modified a new legend is constructed using the requested fontsize.  As a result the old objects are deleted.  When print() attempts to restore the old fontsizes an error results.


 plot (rand (3))
print test.png
legend blue green red
print test-legend.png
error: set: invalid handle (= -16.7054)


A proper fix is to recycle the old objects, or filter out the text strings for legends objects and allow the fontsize property for the legend to do all the work.

Ben Abbott <bpabbott>
Group Member

 

(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 dac922 (Posted a comment)
  • -email is unavailable- added by bpabbott (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-28 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2013-06-22 bpabbott StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code