bugGNU Octave - Bugs: bug #40005, set (ax, "ylim")...

 
 

bug #40005: set (ax, "ylim") incorrectly scales axis from deep within listener hierarchy

Submitter:  Rik <rik5>
Submitted:  Wed 11 Sep 2013 11:10:07 PM 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:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 04 May 2014 11:56:53 PM UTC, comment #4: 

I applied your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/868dcab453bd).  Thanks for taking care of this.  Closing report.

Rik <rik5>
Group administrator
Sun 04 May 2014 08:13:58 PM UTC, comment #3: 

Ok sorry Rik. With this modified protocol, I can reproduce the bug.

The problem is that when the main axes has its limits currently updated, a static recursion variable prevents the colorbar axes from being also updated.

I attached a patch.

(file #31302)

Pantxo Diribarne <pantxo>
Group Member
Thu 01 May 2014 10:01:30 PM UTC, comment #2: 

The problem is still there.  I've re-written the example so that the problem is evident.


##########################################################################
## FIXME: Setting xlim or ylim from within a listener callback
##        causes the axis to change size rather than change limits.
##        Workaround it by jiggling the position property which forces
##        a redraw of the axis object.
##
## To see the problem:
## Comment out the 5 lines below the comment box which jiggle position
##
## Now run the the following code:
##   clear -f
##   clf; contour (peaks ()); colorbar ();
##   caxis ([0 5]);
## Up to this point everything is fine.
##   caxis ("auto");
## Now colorbar will be badly sized.
##
## The problem line is
##   set (hiax, "ylim", cext)
##
## The issue seems to be that the axes object is redrawn to the wrong size
## and then is marked as clean so that further internal calls which set the
## correct size do not cause the object to be refreshed.
##########################################################################


I added the instructions to colorbar.m

Rik <rik5>
Group administrator
Tue 22 Apr 2014 07:45:16 PM UTC, comment #1: 

I can't reproduce this bug. The proposed test doesn't trigger the listener (update_colorbar_clim) in which the keyboard command is set; so I tried the following:


## uncomment the keyboard command and then
close all
contour (peaks ())
colorbar ();
set (gca, "clim", [0 10])    # hit keyboard statement
## now in debug mode
set (hiax, "ylim", [0 0.5])  # properly changes the colorbar ylim


Pantxo Diribarne <pantxo>
Group Member
Wed 11 Sep 2013 11:10:07 PM UTC, original submission:  

See the FIXME note in colorbar.m in subfunction update_colorbar_clim.


## FIXME: Setting xlim or ylim from within a listener callback
##        causes the axis to change size rather than change limits.
##        Workaround it by jiggling the position property which forces
##        a redraw of the axis object.
##
## Debug Example:
## Uncomment the line below.
##   keyboard;
## Now run the the following code.
##   clf; colorbar (); contour (peaks ())
## Once the keyboard command has been hit in the debugger try
##   set (hiax, "ylim", [0 0.5])


The result is that the axis is scaled to half its original value.  Instead, the axis should keep its size and the axis tick labels should change.

Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31302:  axes_limits_update.patch added by pantxo (4KiB - application/x-download)

 

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 (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
    2014-05-04 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2014-05-04 pantxo Attached File- Added axes_limits_update.patch, #31302

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code