On Jan 11, 2:34 pm, gg <qonq...@googlemail.com> wrote:
> I would like to visualize elevation data with iSurface tool using
> following vector for levels
> levels =
> [-1000,1,25,50,100,150,250,350,500,750,1000,1250,1500,1750,2 000,2500,3000]
> i.e. values lower than 1 with light blue color, then green for values
> between 1-25, and so on continuing with yellow, brown, up to value
> 3000, and white for values above. Below is the code which I am trying
> to use for that purpose, but it seems that I am missing something.
>
> pro topo3d
> device, decom=0
> rgb_table = bindgen(256,3)
> rgb_table[0:17,0]=
> [000,140,000,040,080,120,160,200,255,230,200,170,145,120,090 ,135,180,255]
> rgb_table[0:17,1]=
> [000,140,100,125,150,175,200,225,255,220,180,150,110,075,040 ,110,180,255]
> rgb_table[0:17,2]=
> [000,255,000,000,000,000,000,000,000,000,000,000,000,000,000 ,090,180,255]
> levels =
> [-1000,1,25,50,100,150,250,350,500,750,1000,1250,1500,1750,2 000,2500,3000]
> data = hanning(200,200)*3000
> isurface, data, RGB_TABLE=rgb_table,texture_image=bytscl(data),
> vert_colors=levels
> end
>
> Could you please be so kind and provide me some hints how to produce
> figure with surface using custom palette for various levels?
One way is to replace your isurface line with
data_colors=value_locate(levels,data)
isurface,data,rgb_table=rgb_table,vert_colors=data_colors
The vert_colors must contain either the RGB triples, or the indexes
into the given colortable of each vertex. Since you already provide
the colortable through the rgb_table keyword, it is easier to provide
the indexes in vert_colors. You were passing levels, which was being
interpreted as a set of colortable indexes, that was used cyclically
because it was smaller than the number of vertices.
|