comparison scripts/image/imshow.m @ 20038:9fc020886ae9

maint: Clean up m-files to follow Octave coding conventions. Try to trim long lines to < 80 chars. Use '##' for single line comments. Use '(...)' around tests for if/elseif/switch/while. Abut cell indexing operator '{' next to variable. Abut array indexing operator '(' next to variable. Use space between negation operator '!' and following expression. Use two newlines between endfunction and start of %!test or %!demo code. Remove unnecessary parens grouping between short-circuit operators. Remove stray extra spaces (typos) between variables and assignment operators. Remove stray extra spaces from ends of lines.
author Rik <rik@octave.org>
date Mon, 23 Feb 2015 14:54:39 -0800
parents 4197fc428c7d
children 7503499a252b
comparison
equal deleted inserted replaced
20037:a1acca0c2216 20038:9fc020886ae9
206 htmp = image (xdata, ydata, im); 206 htmp = image (xdata, ydata, im);
207 else 207 else
208 htmp = imagesc (xdata, ydata, im, display_range); 208 htmp = imagesc (xdata, ydata, im, display_range);
209 set (gca (), "clim", display_range); 209 set (gca (), "clim", display_range);
210 endif 210 endif
211 set (gca (), "visible", "off", "view", [0, 90], "ydir", "reverse", "layer", "top"); 211 set (gca (), "visible", "off", "view", [0, 90],
212 "ydir", "reverse", "layer", "top");
212 axis ("image"); 213 axis ("image");
213 214
214 if (nargout > 0) 215 if (nargout > 0)
215 h = htmp; 216 h = htmp;
216 endif 217 endif
253 %!demo 254 %!demo
254 %! clf; 255 %! clf;
255 %! imshow (rand (100, 100)); 256 %! imshow (rand (100, 100));
256 %! colormap (jet (64)); 257 %! colormap (jet (64));
257 258
258 %% Test input validation 259 ## Test input validation
259 %!error imshow () 260 %!error imshow ()
260 %!error <IM must be an image> imshow ({"cell"}) 261 %!error <IM must be an image> imshow ({"cell"})
261 %!error <TrueColor image must be uint8> imshow (ones (3,3,3, "uint32")) 262 %!error <TrueColor image must be uint8> imshow (ones (3,3,3, "uint32"))
262 %!error <TrueColor image must be uint8> imshow (ones (3,3,3, "int16")) 263 %!error <TrueColor image must be uint8> imshow (ones (3,3,3, "int16"))
263 %!error <expecting MxN or MxNx3 matrix> imshow (ones (4,4,4)) 264 %!error <expecting MxN or MxNx3 matrix> imshow (ones (4,4,4))