hsv

Colormap that sweeps through the hue circle at full saturation and value.

Category: Graphics > Formatting and Annotation

Syntax

map = hsv

Returns an hsv colormap with the default number of rows.

map = hsv(m)

Returns an hsv colormap with m rows.

Description

The hue runs from 0 to just below 1 in equal steps, so the colors go from red through yellow, green, cyan, blue and magenta, nearly back to red. The first and last colors are close but not identical, and the map is cyclic, which suits angles and phases.

It is built as hsv2rgb([h' ones(m,1) ones(m,1)]) with evenly spaced hues h.

Input arguments

m
Number of colors, a nonnegative integer.

Output arguments

map
m-by-3 matrix of RGB values between 0 and 1.

Example

Four hues

hsv(4)
Output
ans = 4×3

    1.0000         0         0
    0.5000    1.0000         0
         0    1.0000    1.0000
    0.5000         0    1.0000

See also

hsv2rgb rgb2hsv colormap jet parula