spinmap

Rotate colormap colors

Description

spinmap rotates the current colormap by two rows repeatedly for approximately three seconds.

spinmap(t) rotates the current colormap by two rows repeatedly for t seconds.

example

spinmap(t,n) rotates the current colormap by n rows for t seconds.

Examples

collapse all

Create a surface plot that uses the default colormap. Then rotate the colormap by one row for five seconds.

surf(peaks);
colorbar
spinmap(5,1)

Input Arguments

collapse all

Rotation duration, specified as a scalar numeric value or 'inf'. A numeric value specifies the number of seconds to rotate the colormap. A value of 'inf' makes the colormap rotate indefinitely.

Rotation amount, specified as a numeric scalar value. The first rotation shifts each color in the colormap by n rows. Subsequent rotations shift the colormap by an additional n rows.

Positive values increment the rows, where the last color wraps to the first row. A negative value decrements the rows, where the first color wraps to the last row.

Tips

Press Ctrl+C to interrupt the rotation before t has elapsed.

Introduced before R2006a