# HG changeset patch # User Rik # Date 1398981667 25200 # Node ID 01e69fd38459827197c54665e65de7694a497fdf # Parent c7969670146870bdd7b4927fc90ad3283be876dd colorbar.m: Write detailed instructions for reproducing bug #40005 in comment box. * colorbar.m: Write detailed instructions for reproducing bug #40005 in comment box. diff --git a/scripts/plot/draw/colorbar.m b/scripts/plot/draw/colorbar.m --- a/scripts/plot/draw/colorbar.m +++ b/scripts/plot/draw/colorbar.m @@ -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);