Re: gnuplot: plotting each point in different color
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
H.S. wrote:
> Hi,
>
> I have tried Gnuplot mailing list and the newsgroup but didn't get the
> help I was looking for. So here my try there.
>
> Given a data file:
> ######### 3cols.dat #########
> 0.2846 0.1857 1
> 0.8283 0.1330 2
> 0.3306 0.8348 3
> 0.7961 0.7968 4
> #############################
>
> I want to plot the 2-D points given by first two columns in a color
> given by the their label in the last column. The color doesn't matter,
> only that points with a particular label are plotted with the same color.
>
> Here is what I have so far:
> set pm3d
This is to plot 3d surfaces in a 2d representation. You only have two
coordinates, ie a 2d plot.
I did:
set palette
splot '3cols.dat' us 1:2:3 w p palette
I don't know if that's what you want?
> set palette rgb 33,13,10
> set view map
> set cbrange [1:4]
> ssplot "3cols.dat" with points palette pt 9
>
>
> However, a knowledgeable soul at the Gnuplot mailing list has informed
> me that using pm3d is a bad idea (the above command spews out warnings
> about not enough isosamples) and I should use 'plot' command for this.
> But he did not follow that up with a little example.
The knowledgeable soul told you to read the manual.
# aptitude install gnuplot-doc
as ordinary user within a directory for personal documentation:
$ cp /usr/share/doc/gnuplot-doc/gnuplot.ps.gz .
$ gunzip gnuplot.ps.gz
$ ps2pdf gnuplot.ps
$ kpdf gnuplot.pdf
You'll want to read pp. 64ff. (For me this is more convenient, but of
course there are other ways to read the gzipped ps.)
HTH,
Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH7AWUC1NzPRl9qEURAptSAJwMwXfZuWztNuIivD9NC5XSNINiMQCfaSJS
zIaHSeYYNo7vuXbsm0HTIUA=
=5M62
-----END PGP SIGNATURE-----
Reply to: