hsv

Purpose

Hue-saturation-value colormap.

Synopsis

map = hsv
map = hsv(m)
hsv

Description

hsv is used in conjunction with colormap to specify a colormap which varies the hue component of the hue-saturation-value color model. The colors begin with red, pass through yellow, green, cyan, blue, magenta, and return to red. The map is particularly appropriate for displaying periodic functions.

hsv(m) returns an m-by-3 matrix containing an hsv colormap.

hsv, by itself, is the same as hsv(64).

Examples

The statements

format rat
M = hsv(19)
produce

M = 
      1            0            0      
      1           6/19          0      
      1          12/19          0      
      1          18/19          0      
    14/19          1            0      
     8/19          1            0      
     2/19          1            0      
      0            1           4/19    
      0            1          10/19    
      0            1          16/19    
      0          16/19          1      
      0          10/19          1      
      0           4/19          1      
     2/19          0            1      
     8/19          0            1      
    14/19          0            1      
      1            0          18/19    
      1            0          12/19    
      1            0           6/19    
The rows of M that contain just 0s and 1s represent the basic colors red, yellow, green, cyan, blue, magenta and red again. The other rows represent intermediate colors.

Algorithm

hsv(m) is the same as hsv2rgb([h ones(m,2)]) where h is the linear ramp,

h = (0:m-1)'/(m-1);

See Also

colormap, hsv2rgb, rgb2hsv
bone, cool, copper, flag, gray, hot, jet, pink, prism, white

(c) Copyright 1994 by The MathWorks, Inc.