[vtkusers] Simple color mapping question

Johnson, Mike (IS) michael.l.johnson at ngc.com
Fri Mar 12 14:29:10 EST 2010


Hi all,

I have requirements to show a simple 2D surface plot where the data
point values range, let's say, from 0 to 100 (or might be -100 to 200 or
whatever...) Then let's say I want to color like this:

< 20: Red
20-40: Magenta
40-60: Yellow
60-80: Blue
> 80: Green

Right now I have set up a vtkLookupTable and assigned 20 to red, 40 to
magenta, 60 to yellow, and 80 to blue.  A few things - 

1.	By default it appears to map as a "ramp" between the colors; ie,
if the value is 50, it's "magenta-yellowish."  I'd rather just have only
the 5 colors in my map. Is this possible?
		
2.	Since the colors from my #1 above really specify a "range"
instead of a "single point value" (ie, I'd like anything from 20-40 to
be the same color), how do I specify a "less than" (for the "red"
values) and a "greater than" (for the green values)?

Thanks in advance,
Mike Johnson


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100312/bd428288/attachment.htm>


More information about the vtkusers mailing list