;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Name: ; right_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 vertical) 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: ; right_colorbar, im, cb24, POSITION = position, CB_TITLE = cb_title ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pro right_colorbar, im, cb24, POSITION = position, CB_TITLE = cb_title ; Make a colorbar corresponding to a chosen color table. tvlct, r, g, b, /get cb = replicate(1b, 30)#bindgen(256) cb24 = lonarr(30, 256, 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], $ /nodata, /noerase, $ POSITION = position, $ xticks = 1, xtickformat = '(A1)', xstyle = 1,$ yticks = 1, ystyle = 4 axis, yaxis = 1, /save, $ yrange = [minim, maxim], $ yticks = 6, ystyle = 1, ytitle = CB_TITLE ;ytickformat = '(f7.0)', oplot, [0,0], [minim, maxim] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;