mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

vis/directgraphics/

mg_colorbar.pro

direct graphics


Produce a colorbar in direct graphics. Uses the colors in the current color table along with the indices from COLORS (or, alternatively using BOTTOM and NCOLORS) if the RED, GREEN, and BLUE keywords are not set.

Examples

Running the main-level program at the end of the file should produce something like:

Colorbars can be created in indexed color or decomposed color. It can be useful to draw a colorbar when in decomposed color by specifying the the colortable colors with the RED, GREEN, and BLUE keywords and the color of the axis with AXIS_COLOR (as a long integer like '00ffff'x).

Routines

top mg_colorbar

mg_colorbar [, range=fltarr(2)] [, colors=bytarr] [, bottom=long] [, ncolors=long] [, /vertical] [, /horizontal] [, axis_color=color] [, /labels_on_right] [, /labels_on_top] [, red=bytarr(256)] [, green=bytarr(256)] [, blue=bytarr(256)] [, divisions=long] [, xticklen=float] [, yticklen=float] [, ticklen=float] [, xtitle=string] [, ytitle=string] [, _extra=keywords]

Produce a colorbar in direct graphics.

Keywords

range in optional type=fltarr(2) default=[0., 1.]

data range of the colorbar

colors in optional type=bytarr default=bindgen(256)

colors to use in the colorbar

bottom in optional type=long default=0L

first color index to place in the colorbar; ignored if COLORS is specified

ncolors in optional type=long default=256L

number of colors to place in the colorbar; ignored if COLORS is specified

vertical in optional type=boolean

set to display a vertical colorbar; either VERTICAL or HORIZONTAL must be set

horizontal in optional type=boolean

set to display a horizontal colorbar; either VERTICAL or HORIZONTAL must be set

axis_color in optional type=color

color of axis, labels, etc.

labels_on_right in optional type=boolean

set to place axis labels on the right instead of the left on vertical colorbars

labels_on_top in optional type=boolean

set to place axis labels on the top instead of the bottom on horizontal colorbars

red in optional type=bytarr(256) default=current color table

red values of the color table to display; uses the current color table if RED is not present

green in optional type=bytarr(256) default=current color table

green values of the color table to display; uses the current color table if GREEN is not present

blue in optional type=bytarr(256) default=current color table

blue values of the color table to display; uses the current color table if BLUE is not present

divisions in optional type=long default=6L

number of tick intervals along the length of the colorbar; there will be one more tick mark

xticklen in optional type=float

length of tick marks for horizontal colorbars

yticklen in optional type=float

length of tick marks for vertical colorbars

ticklen in optional type=float

length of tick marks on colorbar

xtitle in optional type=string

string for xtitle

ytitle in optional type=string

string for ytitle

_extra in optional type=keywords

keywords to MG_IMAGE

File attributes

Modification date: Wed May 14 15:07:15 2014
Lines: 144
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.