I think you have it backwards.
Do this instead: prescribe the list of values for Band to use either explicitly or with Enumerate.
Provide a corresponding list of RGB values representing the colors you want for each value.
Put the value list into Construct(origin) input and the RGB list into the same Construct(data) input.
The output is a colormap suitable for connecting to the 'colormap' input of Colormap.
Feed this Colormap (and the data field of course) into Color(data, colormap) to color the data, and the same colormap feeds Colorbar or Legend.

Details:
The simple description above works for continuous colormaps, i.e., one data value with one color value.

Band implies that ranges of values receive the same color, so there is slightly more work than for a continuous colormap. Say you want data values 0.0-2.0 to be 'blue', 2.0-3.0 'green', 3.0-10.0 'red'.

The data list // color list // (comment) would be:
0.0 [0, 0, 1]
2.0 [0, 0, 1] (vertical line at blue)
2.0 [0, 1, 0] (horizontal line from blue to green)
3.0 [0, 1, 0] (vertical line at green)
3.0 [1, 0, 0] (horizontal line from green to red)
10.0 [1, 0, 0] (vertical line at red)

A more elegant scheme (that I use) avoids nasty RGB guesswork and uses HSV, so:
Make 3 lists, one of Hue values, where red = 0.0, green = 0.33, blue = 0.66, red = 1.0 (completing the hue cycle); one of Saturation and one of Value (latter two range from 0.0-1.0).
Obviously, the 3 lists must have the same number of items.
Feed these into Compute([a,b,c]) then into Convert("hsv", "rgb").
The output is the list of RGB triplets required for colormap, so that output list goes into the Construct(data) input as above.

By hooking up interactors (lots of interactors), you can dial in both data and HSV values to suit your needs.

Note the coolest part of this is that because your homemade colormap feeds into Colormap, you can pop open the Colormap Editor and watch as you dial in your colormap curves. No guessing! (And thus, the comments on the list above will make sense!).

I can send you screen snapshots if you like; the 2 PDF images total about 1 Mb so I don't want to attach them to this opendx posting.


On Thursday, Feb 17, 2005, at 02:24 America/New_York, Arne Klaveness wrote:

Hello :)

I want to plot the legend of a 2D- band and isosurface plot... The problem I have, is getting the information from the colors in the bandplot into the Legend or Colorbar (the color from the colormap is continious, while I want the discrete colors of the isosurfaces in the bandplot).

Any Idea where I should look?

Arne

*****************************************************************
Arne Klaveness
Department of Chemistry, University of Oslo
PO Box 1033 Blindern
N-0315 OSLO, NORWAY

Email: [EMAIL PROTECTED]
Mobile: +47 480 09 490
*****************************************************************

_______________________________
Chris Pelkie
Scientific Visualization Producer
622 Rhodes Hall, Cornell Theory Center
Ithaca, NY 14853 (607) 254-8794

Reply via email to