bugGNU Octave - Bugs: bug #42285, linkprop doesn't always work with...

 
 

bug #42285: linkprop doesn't always work with axes limits

Submitted by:  Pantxo Diribarne <pantxo>
Submitted on:  Sun 04 May 2014 08:36:12 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 30 May 2014 10:08:15 AM UTC, comment #6:

What about adding an argument to addlistener? This argument could be a list of handles of objects that are necessary for the listener function to work.
Then addlistener could feed the deletfcn callback list of those objects with the appropriate dellistener function. Not sure my explanation is clear so here is an example in which changing the linewidth of the axes would change the linewidth of its line children:

The fourth argument simply adds "dellistener (ax, "linewidth", {@update_width, li})" to li's deletefcn callback list.

Pantxo Diribarne <pantxo>
Project Member
Mon 19 May 2014 03:07:26 PM UTC, comment #5:

Your example does produce an error. Actually, I think polar needs to be overhauled anyways because the first two commands don't work either.

In this case the hggroup which defines the polar grid is left in place.

This piece of code is also imperfect:

Because the legend object is implemented as another axis of the figure it isn't cleared when the first axis is.

Rik <rik5>
Project Administrator
Sat 17 May 2014 10:23:52 AM UTC, comment #4:

Among the repercussions I can see, any listenner that is added to an axes (or figure) should be accompanied by a deletefcn that dellistener. For example, I suspect the new polar grid, that inherits some of its parent axes properties, will leave out-dated listeners onces deleted (can't test it at the moment as I can't pull). The following code should then throw errors:

Pantxo Diribarne <pantxo>
Project Member
Fri 16 May 2014 03:20:48 PM UTC, comment #3:

This was pretty easy to fix, although I guess we should make sure there are no other repercussions. In graphics.in.h, there is this piece of code:

I simply took out the remove_all_listeners() function call and then Octave works the same as Matlab. I verified that your sample piece of code works with that change.

The only way to get rid of a listener now is to explicitly delete it with dellistener or destroy the axes object with delete (gca).

The changeset is here (http://hg.savannah.gnu.org/hgweb/octave/rev/10082673a8f0).

Rik <rik5>
Project Administrator
Fri 16 May 2014 12:57:01 PM UTC, comment #2:

Yes, the example works in matlab. The "plot" command doesn't remove axes listeners, neither does "reset" (AFAIU "cla reset" is equivalent to "reset (gca)") command:

I should probably consider this in order to update my patch for bug #35511.

Pantxo Diribarne <pantxo>
Project Member
Thu 15 May 2014 09:33:12 PM UTC, comment #1:

Does the example code work in Matlab? I would expect the final call to plot (1:10) would call newplot() which in turn would reset the axes to a default state including destroying any listeners. If I mimic that sequence then I do get exactly what Octave does.

Rik <rik5>
Project Administrator
Sun 04 May 2014 08:36:12 PM UTC, original submission:

The following example demonstrates the bug

Explicitly changing "ylim" works, but when the "ylim" of an axes is updated due to a data change, "ylim" value is not propagated to the other axes.

Pantxo Diribarne <pantxo>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 16 May 2014 03:20:48 PM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Thu 15 May 2014 09:33:12 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1