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

Home » Public Forums » archive » Re: isurface with custom palette
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: isurface with custom palette [message #69418 is a reply to message #69269] Tue, 12 January 2010 09:05 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jan 12, 2:34 pm, gg <qonq...@googlemail.com> wrote:
> On Jan 12, 5:23 pm, pp <pp.pente...@gmail.com> wrote:
>
>> On Jan 12, 2:12 pm, gg <qonq...@googlemail.com> wrote:
>
>>> Thanks a lot! This is exactly what I needed. Now, if I am not asking
>>> too much, I would like to know if is posible to insert colorbar with
>>> data_colors values but not as specified by the RGB_TABLE keyword?
>
>> I am not sure of what you mean. Do you want the colorbar labels to be
>> values like
>> [-1000,1,25,50,100,150,250,350,500,750,1000,1250,1500,1750,2 000,2500,3000]
>> corresponding to the colors you defined in rgb_table? Or is it other
>> values?
>
> Yes, I would like to have colorbar values exactly with the values
> [-1000,1,25,50,100,150,250,350,500,750,1000,1250,1500,1750,2 000,2500,3000]

Then, it would be just a matter of adding /insert_colorbar to the
isurface call.

But my guess is you will not like the result. The reason is the way
you created your colortable. It has 256 levels, where the first 18 are
those discrete colors you set, and the next 238 you do not use in your
surface. But the colorbar inserted will have all the 256 colors, not
just the 18 you used, thus the extra 238 odd colors at its end.

One way to solve this is to change the definition of the colorbar, so
that it spans uniformly the 0-255 range, with 18 regions of repeated
values, since you want only 18 discrete levels. It can be done with
congrid to expand the 0-17 0-255 ranges with nearest neighbour
interpolation (thus keeping the levels discrete):

rgb_e=congrid(rgb_table[0:17,*],256,3)
levels_e=congrid(levels,256)
data_colors=value_locate(levels_e,data)
isurface,data,rgb_table=rgb_e,vert_colors=data_colors,/inser t_colorbar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: pointer & structure
Next Topic: Re: idlwave segfault

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

Current Time: Fri Oct 10 09:38:33 PDT 2025

Total time taken to generate the page: 0.56038 seconds