|
From: Robert H. <en...@no...> - 2005-08-16 17:46:28
|
On Tue, 2005-08-16 at 10:06 -0700, Ethan Merritt wrote:
> On Tuesday 16 August 2005 09:58 am, Robert Hart wrote:
> > On Tue, 2005-08-16 at 09:26 -0700, Ethan Merritt wrote:
> >
> > > That works, or would if you put parens around the expression:
> > > set pm3d
> > > splot "data" using 1:2:3:(rgb($1,$2,$3)) with lines
> > >
> >
> > Are you sure? This just gives: undefined function rgb.
>
> I assumed that "rgb" was a user-defined function that assigned
> an rgb color on the basis of 3D coords x, y, and z.
Maybe I'm missing something really obvious here? I don't understand what
you mean by "assigned an rgb color". How could I make a function return
an rgb colour?
I want to plot my data such that the colour of each point is defined by:
r=x
g=y
b=z
Now as I understand it, rgb(some colour specifier) is the gnuplot way of
specifying an arbitrary colour as in:
plot sin(x) lc rgb("salmon")
or
plot sin(x) lc rgb("#123456")
now clearly the colorspec should support colours specified as three
colour components, as in:
plot sin(x) lc rgb(0.1, 0.2, 0.3)
although I realise it doesn't.
So to me, one of:
splot "data" using 1:2:3 lc rgb(x,y,z)
or
splot "data" using 1:2:3:(rgb($1,$2,$3)) lc variable
or some other variant should work.
To make it easy, I have calculated the hex colour value in my data file
(column 5), and am willing to accept that there maybe some way to write
a function which does some kind of string concatenation magic to acheive
the same. Whatever.
Specifically what I'm trying to do is visualise the gamut of colours
used in an image file, such as a photo. I used Imagemagick to quantise
the number of discrete colours down to a more manageable level, and then
for each unique colour count how many pixels are of each colour.
I then want to visualise this in 3D by plotting a point at
(x,y,z)=(r,g,b) with pointsize log(count) and colour (r,g,b)=(r,g,b)
err... I'm not sure how else to explain.
Rob
--
Robert Hart <en...@no...>
University of Nottingham
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
|