changeset 18749:01e69fd38459

colorbar.m: Write detailed instructions for reproducing bug #40005 in comment box. * colorbar.m: Write detailed instructions for reproducing bug #40005 in comment box.
author Rik <rik@octave.org>
date Thu, 01 May 2014 15:01:07 -0700
parents c79696701468
children 89055521e04d
files scripts/plot/draw/colorbar.m
diffstat 1 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/colorbar.m	Thu May 01 12:34:50 2014 -0700
+++ b/scripts/plot/draw/colorbar.m	Thu May 01 15:01:07 2014 -0700
@@ -311,18 +311,30 @@
       set (hiax, "xlim", cext);
     endif
 
+    ##########################################################################
     ## 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]) 
+    ## 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.
+    ##########################################################################
     pos = get (hiax, "position");
     pos(1) += eps;
     set (hiax, "position", pos);