|
From: Theo H. <th...@ph...> - 2005-08-17 14:04:19
|
Theo Hopman wrote:
> `set palette functions` would work well here. The following assumes 8
> bits for each component, but can be modified to handle more. It also
> assumes that the r,g,b components are specified in the data file as
> integers from 0--255.
>
> rgb(r,g,b)=int(r*65536)+int(g*256)+int(b)
> r(gray)=int(2.**24*gray)/65536/256.
> g(gray)=int(2.**24*gray)%65536/256/256.
> b(gray)=int(2.**24*gray)%256/256.
> set palette color model RGB functions r(gray),g(gray),b(gray)
> set cbrange [0:2.**24-1]
> unset colorbox
> splot 'colour-data.txt' using 1:2:3:(log($4)) \
> with points pointtype 6 pointsize variable lc("black"), \
> '' using 1:2:3:(rgb($1,$2,$3)) \
> with points pointtype 7 palette
Grr. This works in theory, but not in practise, and the (wrong) results
are different on different terminals. I suspect that the rapidly varying
rgb() function is being sampled at a relatively low frequency to get a
limited set of grey values. The binning of the rgb() values causes wrong
(encoded) gravy values to be given to the r(), g() and b() functions,
resulting in incorrect colours -- red is almost right, but green is
wrong, and is useless.
THeo
|