rehctawrats
rehctawrats

Reputation: 221

Gnuplot: 3D plot scattered data with color

How can I plot (many) uncorrelated points from a data file in 3D with color corresponding to the value of one column? The color-value is non-integral.

======================================================================

details:

I have a large data file with three columns of the form

longitude     latitude      color

The data is scattered and uncorrelated, i.e. no underlying grid and no relationship between the points (except that every coordinate appears only once). color is an arbitrary scalar. I know the min and the max value of that, and would like to have linear scaling of the color in between. Which colormap is not clear atm, a first step would be to produce any meaningful output.

How can I plot dots on the longitude-latitude coordinates on the unit sphere (i.e. radius = 1) with the specified color?

No interpolation is wanted, not even a connection between the points. (I'm also happy for suggestions how to do that in an easy way, but it's actually not important)

This is how far I've gone, but the coloring is missing:

set mapping spherical splot 'the_file.data' u 1:2:(1)

Thanks a bunch!

Upvotes: 3

Views: 4073

Answers (1)

Christoph
Christoph

Reputation: 48390

You can use linecolor palette, which allows you to specify an additional column which is used to select the respective color from the current palette:

set mapping spherical
splot 'the_file.data' using 1:2:(1):3 linecolor palette

Upvotes: 2

Related Questions