Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: mapping z-values as point colors onto 2D plot

1,560 views
Skip to first unread message

Hallmarc

unread,
Oct 24, 2007, 1:31:48 PM10/24/07
to
Hi everyone,

Any help with this is much appreciated. I have a 3 column data file
that I would like to plot in 2D, with the 3rd column of the row
representing the color (within a spectrum) of that point. I've tried
a few things, including splotting with pm3d, but I can't seem to get
the thing that I want. This seems quite simple, and I think I just
haven't worked with Gnuplot long enough to get the fundamental
concept. Feel free to berate me, because I've read a whole lot of the
manual but can't figure this out.

Regards,
Marc

Ethan Merritt

unread,
Oct 24, 2007, 1:39:50 PM10/24/07
to
In article <1193247108....@i13g2000prf.googlegroups.com>,

Hallmarc <mchi...@gmail.com> wrote:
>Hi everyone,
>
>Any help with this is much appreciated. I have a 3 column data file
>that I would like to plot in 2D, with the 3rd column of the row
>representing the color (within a spectrum) of that point. I've tried
>a few things, including splotting with pm3d, but I can't seem to get
>the thing that I want. This seems quite simple, and I think I just
>haven't worked with Gnuplot long enough to get the fundamental
>concept.

Maybe:
set view map
splot 'data' using 1:2:3 with pm3d

If that's not it, then you need to explain more clearly what
you are aiming for.
--
Ethan A Merritt

Hallmarc

unread,
Oct 24, 2007, 2:56:37 PM10/24/07
to
On Oct 24, 1:39 pm, merr...@u.washington.edu (Ethan Merritt) wrote:
> In article <1193247108.148779.97...@i13g2000prf.googlegroups.com>,

>
> Hallmarc <mchiar...@gmail.com> wrote:
> >Hi everyone,
>
> >Any help with this is much appreciated. I have a 3 column data file
> >that I would like to plot in 2D, with the 3rd column of the row
> >representing the color (within a spectrum) of that point. I've tried
> >a few things, including splotting with pm3d, but I can't seem to get
> >the thing that I want. This seems quite simple, and I think I just
> >haven't worked with Gnuplot long enough to get the fundamental
> >concept.
>
> Maybe:
> set view map
> splot 'data' using 1:2:3 with pm3d
>
> If that's not it, then you need to explain more clearly what
> you are aiming for.
> --
> Ethan A Merritt

Unfortunately, there's something I'm not understanding about pm3d:

gnuplot> splot "socks.dat" using 1:3:4 with pm3d
Warning: Single isoline (scan) is not enough for a pm3d plot.
Hint: Missing blank lines in the data file? See 'help pm3d' and
FAQ.

socks.dat is a file with several hundred thousand rows, four columns
(column 2 is not used), and no breaks between rows. I want gnuplot to
plot column 1 on the x axis, column 3 on the y axis, and column 4
needs to be the color of the point at that (x,y) coordinate. The
colors range from 0 to 4500. The top of the data file has a few
comments (#), a single blank line, then the rest of the data.

Any ideas?

Hans-Bernhard Bröker

unread,
Oct 24, 2007, 3:41:37 PM10/24/07
to
Hallmarc wrote:

> Unfortunately, there's something I'm not understanding about pm3d:
>
> gnuplot> splot "socks.dat" using 1:3:4 with pm3d
> Warning: Single isoline (scan) is not enough for a pm3d plot.
> Hint: Missing blank lines in the data file? See 'help pm3d' and
> FAQ.
>
> socks.dat is a file with several hundred thousand rows, four columns
> (column 2 is not used), and no breaks between rows.

... which means it doesn't describe any surface, so pm3d can't plot it
as a coloured surface. Looks like what you really want is a plot of
coloured points, i.e.:

set view map
splot 'data' u 1:2:(0.0):3 with points palette

Either that, or you should insert the missing breaks into the data file.

Hallmarc

unread,
Oct 24, 2007, 4:33:10 PM10/24/07
to
On Oct 24, 3:41 pm, Hans-Bernhard Bröker <HBBroe...@t-online.de>
wrote:

That did the trick, thanks! I guess the third coordinate of 0.0 just
basically push everything up against a 2D plane...excellent.

Alicreance Hiyadutuje

unread,
Sep 20, 2022, 8:18:14 AM9/20/22
to
In my case, I was missing only "with points palette".
0 new messages