DADiSP Worksheet Functions > Function Categories > Colors > COLORBAR

 

COLORBAR

Purpose:

Adds a vertical color bar to a Window.

Syntax:

COLORBAR(win, fullscale)

win

-

Optional. A Window to obtain colormap. Defaults to the current Window or the system colormap if the current Window is empty.

fullscale

-

Optional. An Integer, the color scale mode.

0:

autoscale, scale color range to Window values (default)

1:

use full scale color range

Returns:

Overlays a vertical colorbar to the right of the current Window.

Examples:

(x, y) = fxyvals(-1, 1, 0.1, -1, 1, 0.1)

W1: cos(x*y);setplotstyle(0);setplottype(4)

W2: 2*W1;rainbow;colorbar

 

image\colorbarpic.gif

 

W2 contains a shaded 3D surface. A vertical color bar scaled to the values of W2 is overlayed onto W2.

Example:

setcrange(0, 2)

W3: W1;colorbar(1)

W4: W1;colorbar(0)

 

The color range is now scaled to Z values from 0.0 to 2.0. The colorbar added in W3 shows the full color range while the colorbar of W4 is scaled to the values of W4.

Remarks:

The colorbar is an overlay. Use the FOCUS command to directly manipulate the colorbar and UNOVERPLOT to remove the colorbar.

 

See SETCOLORBARLABEL to set the label for the colorbar.

See Also:

FOCUS

GETCOLORBARLABEL

OVERLAY

SETCOLORBARLABEL

SETCOLORMAP

SETCRANGE

SETSHADING

SHOWCMAP

UNOVERPLOT