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

Home » Public Forums » archive » Re: color by variable interpolate?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: color by variable interpolate? [message #50124 is a reply to message #50123] Tue, 12 September 2006 08:16 Go to previous messageGo to previous message
vorticitywolfe is currently offline  vorticitywolfe
Messages: 19
Registered: January 2006
Junior Member
Thanks David for your help! That is a pretty nifty function (bytscl).
In the end, my final code looks like this for anyone who is
interested...

LoadCT, 34, /silent ; Rainbow color table

; Scale temp from 12 to 255.
color = BytScl( T, Top=255-12) + 12B

plot,x,y,/nodata
PLOTS, x,y , PSym=sym(3), Color=color

Note that in the absence of the for loop, as David mentioned, you do
not need to sort the array and color=color not T. :-)


David Fanning wrote:
> David Fanning writes:
>
>> I think I would do it like this:
>>
>> LoadCT, 33 ; Rainbow color table
>>
>> ; Scale temp from 12 to 255.
>> color = BytScl(T, Top=255-12) + 12B
>>
>> ; Sort temp from cold to hot
>> sortIndex = Sort(T)
>> x = x[sortIndex]
>> y = y[sortIndex]
>> T = T[sortIndex]
>> PLOT, x, y, /NoData
>> PLOTS, x, y, PSym=sym(3), Color=T
>
> Whoops! Brain jam.
>
> I was trying to use your PLOTS command, which would
> require your temperature array to be sorted, if you
> want to use it in the loop, as in your example. In my
> example, I have done away with the loop, so no sorting
> is necessary.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing the Dec labeling from horizontal to vertical
Next Topic: Reading from the prompt

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

Current Time: Sat Oct 11 21:38:56 PDT 2025

Total time taken to generate the page: 2.87645 seconds