bugGNU Octave - Bugs: bug #49769, struct2hdl does not restore...

 
 

bug #49769: struct2hdl does not restore legends or colorbars fully

Submitter:  Muhali <muhali>
Submitted:  Mon 05 Dec 2016 12:31:48 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 11 Dec 2016 10:03:50 PM UTC, comment #6: 

The problem is that, by default (without the "hilev" option), legends are turned into regular axes for which the "visible" property is not interpreted the same way by the rederer.

@Rik: The idea of the "hilev" argument was to make use of high level functions to restore listeners. This option was meant to be enabled whenever we want to load dynamic objects, like in hdload, unfortunately it is untested up to now and the code behind it is probably not the right way to go. I would not recommend to enable it until we have a proper mechanism to reload objects which heavily rely on listeners (legends, colorbars, bar groups ...).

PS: I have proposed an improvement in bug #44670 that make struct2hdl more compatible with Matlabs old .fig format. When I get some time, I'll try to rebase those changes and propose some cleanup same time.

Pantxo Diribarne <pantxo>
Group Member
Fri 09 Dec 2016 08:31:02 PM UTC, comment #5: 

Separately, I improved the performance of hdl2struct about 40% in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/763ec7cbee9e).

Rik <rik5>
Group administrator
Wed 07 Dec 2016 04:25:10 PM UTC, comment #4: 

Adding Pantxo to the CC list since I believe he wrote these functions originally.

I can confirm that hdl2struct successfully saves a legend object in the struct.  But struct2hdl does not restore it completely.  There is an optional third input to struct2hdl which when set to 'true' helps a bit.  But I'm shooting in the dark here.

Rik <rik5>
Group administrator
Tue 06 Dec 2016 04:36:23 PM UTC, comment #3: 

Adding colorbars to the bug report since this special object is also not tagged correctly.

Rik <rik5>
Group administrator
Tue 06 Dec 2016 04:32:39 PM UTC, comment #2: 

Changing title to reflect the root issue.  Although an axes object is partially restored, it is not a true legend object.  It lacks, for example, the tag "legend".  Restoring that tag is enough to correct the display of the object.

Rik <rik5>
Group administrator
Mon 05 Dec 2016 11:51:41 PM UTC, comment #1: 

Confirmed.  hdl2struct and struct2hdl do not seem to have been reviewed.  There are functional as well as performance issues here.

Rik <rik5>
Group administrator
Mon 05 Dec 2016 12:31:48 PM UTC, original submission:  

In the example


plot([2 1])
legend("a") ;
legend boxoff

hgsave foo.og
hgload foo.og


the loaded graphics has the legend box on.

Muhali <muhali>

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-07 rik5 Carbon-Copy- Added pantxo
    2016-12-06 rik5 Summarystruct2hdl does not restore legends fully struct2hdl does not restore legends or colorbars fully
    2016-12-06 rik5 Summaryhgload ignoring legend boxoff struct2hdl does not restore legends fully
    2016-12-05 rik5 CategoryNone Octave Function
        Item GroupNone Incorrect Result
        StatusNone Confirmed
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code