;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Name: ; horiz_colorbar.pro ; ; Purpose: ; This program displays the colorbar corresponding to a chosen image and color table. The ; minimum end maximum values of the colorbar are set according to those of the image. An ; optional parameter can be given to specify where the colorbar (which is horizontal) should ; be placed in the opened window. ; ; ; Author: ; Vito Alberga ; (An auxiliary program by David Fanning has been also used). ; ; Date: ; November 1999 ; ; Calling sequence: ; horiz_colorbar, im, cb24, POSITION = position, CB_TITLE = cb_title ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pro horiz_colorbar, im, cb24, POSITION = position, CB_TITLE = cb_title ; Make a colorbar corresponding to a chosen color table. tvlct, r, g, b, /get cb = bindgen(256)#replicate(1b, 30) cb24 = lonarr(256, 30, 3) cb24(*, *, 0) = r(cb) cb24(*, *, 1) = g(cb) cb24(*, *, 2) = b(cb) ; Display the colorbar. tvimage, cb24, true = 3, POSITION = position minim = min(im) maxim = max(im) print, "min and max of im:", minim, maxim plot, [minim, maxim], [0, 1], $ xrange = [minim, maxim], $ /nodata, /noerase, $ POSITION = position, $ xticks = 6, xtickformat = '(f7.2)', xstyle = 1, xtitle = CB_TITLE, $ yticks = 1, ytickformat = '(A1)', ystyle = 1 end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;