Hi all,
I'm having trouble getting colors in a 2D data array to agree with my colorbar range. How can I set a Min and Max value for colors in an image without requiring the data be scaled to use the whole range?
i.e. My color bar goes from -500 (blue) to 500 (red) and the values in the field only range between 100 and 400. How do I set the colors in the field to match their corresponding colors in the colorbar? I know they are not currently corresponding because I am getting blue colors in field even though there are no negative values.
I tried setting Min = -500 and Max = 500 in the cgimage command, but it did not seem to make a difference.
I'm sure there is some simple oversight here, but I'm not finding it.
Cheers,
Travis
;; Image
i = WHERE(velarray EQ 0.000, count)
IF (count GT 0) THEN velarray[i] = 600 ; non-measurements will be transparent
LOADCT,0
background = BYTARR(720,600)
background(*,*) = 255 ; creates a white background
CGIMAGE, velarray, AlphaBackgroundImage=background, CTIndex=34, $
Missing_Value=600, POSITION=[.12,.10,.83,.95]
;; Axes Overplot - Likely irrelevant here
PLOT,[1],[1],/nodata,xrange = [-1.5,1.5],yrange= [-1.5,1.5], $
xstyle=1,ystyle=1,position = [.12,.10,.83,.95],xtitle = 'Arcseconds', $
ytitle = 'Arcseconds', title = '[SIII] Velocity - Red Line'
;; Color Bar
LOADCT,34
CGCOLORBAR, position=[0.83,0.10,0.86,0.95], divisions=6, minor=7, $
format='(F5.0)', range=[-500, 500], title='Velocity (km/s)', /vertical, /right
|