<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

Colors/

colorbar.pro

The purpose of this routine is to add a color bar to the current graphics window.

topCOLORBAR Graphics, Widget

COLORBAR, BOTTOM=BOTTOM, CB_CHARSIZE=CB_CHARSIZE, CB_CHARTHICK=CB_CHARTHICK, CB_COLOR=CB_COLOR, DIVISIONS=DIVISIONS, DISCRETE=DISCRETE, CB_LABEL=CB_LABEL, FORMAT=FORMAT, POSITION=POSITION, MAX=MAX, MIN=MIN, NCOLORS=NCOLORS, PSCOLOR=PSCOLOR, CB_TITLE=CB_TITLE, VERTICAL=VERTICAL, TOP=TOP, RIGHT=RIGHT, CB_LOG=CB_LOG, NOTITLE=NOTITLE, _EXTRA=_EXTRA

Keywords

BOTTOM        default: 0B

The lowest color index of the colors to be loaded in the bar.

CB_CHARSIZE        default: 1.0

The character size of the color bar annotations.

CB_CHARTHICK        default: 1.0

The character thick of the color bar annotations.

CB_COLOR        default: ncolors - 1 + bottom

The color index of the bar outline and characters.

DIVISIONS        default: 2

The number of divisions to divide the bar into. There will be (divisions + 1) annotations.

DISCRETE       

Vector which contain color's indexes to trace in a color bar. Therefore we obtain a discrete colorbar which contains only the specified colors in the order they appear in the vector

CB_LABEL       

A vector to specify sticks values of the color bar. It allowes, when we use DISCRETE, to have colors that don't increase by increments in a regular way.

FORMAT        default: '(F6.2)'

The format of the bar annotations.

POSITION        default: see bellow

A four-element array of normalized coordinates in the same form as the POSITION keyword on a plot. Default is [0.88, 0.15, 0.95, 0.95] for a vertical bar and [0.15, 0.88, 0.95, 0.95] for a horizontal bar.

MAX        default: NCOLORS - 1

The maximum data value for the bar annotation.

MIN        default: 0

The minimum data value for the bar annotation.

NCOLORS        default: !D.N_COLORS

This is the number of colors in the color bar.

PSCOLOR       

This keyword is only applied if the output is being sent to a Postscript file. It indicates that the Postscript device is configured for color output. If this keyword is set, then the annotation is drawn in the color specified by the COLOR keyword. If the keyword is not set, the annotation is drawn in the color specified by the !P.COLOR system variable (usually this will be the color black). In general, this gives better looking output on non-color or gray-scale printers. If you are not specifically setting the annotation color (with the COLOR keyword), it will probably be better NOT to set this keyword either, even if you are outputting to a color Postscript printer.

CB_TITLE        default: ''

This is title for the color bar.

VERTICAL        default: 0 -> horizontal color bar

Setting this keyword give a vertical color bar.

TOP       

This puts the labels on top of the bar rather than under it. The keyword only applies if a horizontal color bar is rendered.

RIGHT       

This puts the labels on the right-hand side of a vertical color bar. It applies only to vertical color bars.

CB_LOG       

to get logarithmic scale for the colorbar

NOTITLE       

Force to don't write title even if CB_TITLE is declared.

_EXTRA       

pass any keyword to colorbar

Examples

To display a horizontal color bar above a contour plot, type: IDL> LOADCT, 5, NCOLORS=100 IDL> CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $ IDL> C_COLORS=INDGEN(25)*4, NLEVELS=25 IDL> COLORBAR, NCOLORS=100

Version history

Version

$Id: colorbar.pro 155 2006-08-11 14:32:05Z smasson $

History

Written by: David Fanning, 10 JUNE 96. 10/27/96: Added the ability to send output to PostScript. DWF 11/04/96: Substantially rewritten to go to screen or PostScript file without having to know much about the PostScript device or even what the current graphics device is. DWF 01/27/97: Added the RIGHT and TOP keywords. Also modified the way the TITLE keyword works. DWF 07/15/97: Fixed a problem some machines have with plots that have no valid data range in them. DWF 03/03/98: Add DISCRETE keyword, sebastien masson (smasson@lodyc.jussieu.fr)

Known issues

Restrictions

The number of colors available on the display device (not the Postscript device) is used unless the NCOLORS keyword is used.
Produced by IDLdoc 2.0.