diff scripts/image/hsv.m @ 20724:0338dc274ec5

Rewrite colormap demos with rgbplot() to show both composite and profile. * scripts/image/autumn.m, scripts/image/bone.m, scripts/image/cool.m, scripts/image/copper.m, scripts/image/cubehelix.m, scripts/image/gray.m, scripts/image/hot.m, scripts/image/hsv.m, scripts/image/jet.m, scripts/image/ocean.m, scripts/image/pink.m, scripts/image/rainbow.m, scripts/image/spring.m, scripts/image/summer.m, scripts/image/viridis.m, scripts/image/white.m, scripts/image/winter.m: rewrite the demos to make use of rgbplot instead of manually creating the composite view. Also expand it to include the rgb profile of the colormap under the composite view to better understand the colormap. Expand the number of colours in the demo to 256 for smoother curves. * scripts/image/flag.m, scripts/image/lines.m, scripts/image/prism.m: same as above but since these are periodic colormaps, change the default length to show 3 cycles.
author Carnë Draug <carandraug@octave.org>
date Thu, 19 Nov 2015 17:09:06 +0000
parents 7503499a252b
children 516bb87ea72e
line wrap: on
line diff
--- a/scripts/image/hsv.m	Thu Nov 19 17:05:36 2015 +0000
+++ b/scripts/image/hsv.m	Thu Nov 19 17:09:06 2015 +0000
@@ -57,9 +57,11 @@
 endfunction
 
 
+## A better demo of this colormap would be to plot the hsv values.
 %!demo
-%! ## Show the 'hsv' colormap as an image
-%! image (1:64, linspace (0, 1, 64), repmat ((1:64)', 1, 64));
-%! axis ([1, 64, 0, 1], "ticy", "xy");
-%! colormap (hsv (64));
-
+%! ## Show the 'hsv' colormap profile and as an image
+%! cmap = hsv (256);
+%! subplot (2, 1, 1);
+%! rgbplot (cmap, "composite");
+%! subplot (2, 1, 2);
+%! rgbplot (cmap);