comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Color bar colors not matching Image colors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Color bar colors not matching Image colors [message #87306] Thu, 23 January 2014 12:30 Go to previous message
fischertc13 is currently offline  fischertc13
Messages: 4
Registered: October 2012
Junior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: binning a point clouds in the xy plane
Next Topic: Plus Minus in t=TEXT()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:33:06 PDT 2025

Total time taken to generate the page: 0.00450 seconds