|
From: Theo H. <th...@ph...> - 2005-08-16 19:04:03
|
Ethan Merritt wrote:
> I'd have to think about whether there is a straight-forward way
> to implement the notion "rgb triplet generated by function and
> then assigned to linecolor". It may be possible, but I don't
> off the top of my head see how it would fit into the current
> scheme. Which is to say, it may be a nightmare to implement
> even if it's a good idea from the perspective of user interface.
It seems to me Rob wants something like the `rgbimage` plotting style,
where x,y,z and r,g,b are specified independently, but not limited to a
rectangular sampling grid.
> If you have a specific set of discrete colors, then I think what you
> need to do for perfect accuracty is to define a discrete palette that
> consists of exactly these colors. Let's say you discretize to 128
> colors, and define a palette of size 128. Then you can specify your
> point colors by choosing directly from this palette:
>
> rgb(x,y,z) = some-function-that-generates-the-palette-index
>
> plot <foo> using 1:2:3:(rgb($1,$2,$3)) lt palette
`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
The point types are chosen to give hollow and filled circles
respectively on the x11 terminal. Unfortunately it does not seem to be
possible to have varying point sizes _and_ colours set independently of
the z value.
THeo
|