# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1295208874 21600 # Node ID 0df61c879c2876dfd2815754fe780dbe4c273e75 # Parent 50a7935f25122c94ecde47007013ca64d4d2f15f set clim to [0,1] so that scaled cdatamapping works as intended. diff -r 50a7935f2512 -r 0df61c879c28 scripts/ChangeLog --- a/scripts/ChangeLog Sun Jan 16 08:58:46 2011 -0600 +++ b/scripts/ChangeLog Sun Jan 16 14:14:34 2011 -0600 @@ -1,3 +1,8 @@ +2011-01-16 Jordi GutiƩrrez Hermoso + + * image/imshow.m: set clim to [0,1] so that scaled cdatamapping + works as intended. + 2011-01-15 Rik * scripts/help/doc.m, scripts/help/which.m, diff -r 50a7935f2512 -r 0df61c879c28 scripts/image/imshow.m --- a/scripts/image/imshow.m Sun Jan 16 08:58:46 2011 -0600 +++ b/scripts/image/imshow.m Sun Jan 16 14:14:34 2011 -0600 @@ -124,15 +124,17 @@ case {"double", "single", "logical"} display_range = [0, 1]; case {"int8", "int16", "int32", "uint8", "uint16", "uint32"} - ## For compatibility, uint8 data should not be handled as - ## double. Doing so is a quick fix to allow the images to be - ## displayed correctly. - display_range = double ([intmin(t), intmax(t)]); + display_range = [intmin(t), intmax(t)]; otherwise error ("imshow: invalid data type for image"); endswitch endif + ## For compatibility, uint8 data should not be handled as + ## double. Doing so is a quick fix to allow the images to be + ## displayed correctly. + display_range = double(display_range); + ## Check for complex images. if (iscomplex (im)) warning ("imshow: only showing real part of complex image"); @@ -165,6 +167,7 @@ else tmp = image (im); set (tmp, "cdatamapping", "scaled"); + set (gca (), "clim", [0,1]); endif set (gca (), "visible", "off", "ydir", "reverse"); axis ("image");