| Re: colors of images [message #7695 is a reply to message #7684] |
Tue, 10 December 1996 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Rafael Gallego <rafa@hp1.uib.es> writes:
> Hi!
> I have done a program which generates in each time step three matrix.
> I want to plot all of them in the same image in each time step in such
> way that I can see the film of the system evolution. My problem arises
> with the colors for each array. I wanted that, say the array A1, was
> ploted with the color red, the array A2 with the green one and the array
> A3 with the blue one. The intensity of each color of course would be
> scaled with the respective array values. Then, I would see red a region
> in which A1 dominates, for instance. If it had a mixture of A1, A2 and
> A3, I would see a mixture of the three colors, red, green and blue. And
> this for each time step. My question is very simple:
> How can I accomplish what I want to do ?
> Thanks in advance and sorry for my English. I am not used to writting in
> English.
Simply define a color table which uses different parts for different images.
For example:
nc = !d.nc / 3 ;One third of the color table
r=intarr(3*nc) & g=r & b=r ;Initialize color tables
x = 256*indgen(nc) / nc ;Generic color scale
r(0) = x ;First third is red
g(nc) = x ;Second third is green
b(2*nc) = x ;Last third is blue
tvlct, r, g, b ;Load the color tables
tv,bytscl(i1,top=nc),0 ;Display first image
tv,bytscl(i2,top=nc)+nc,1 ;Display second image
tv,bytscl(i3,top=nc)+2*nc,2 ;Display last image
Bill Thompson
|
|
|
|