3

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!

4
  • Take a look at help linecolor variable... splot "the_file.data" u 1:2:3 with points linecolor variable maybe? Commented Oct 23, 2017 at 16:28
  • Unfortunately that requires the values of the color column to be integral. However, they aren't, I didn't mention that before. There are too many different of them, i.e. a manual classification is not possible. Commented Oct 23, 2017 at 17:20
  • 1
    set autoscale cbfix; splot 'the_file.data' u 1:2:(1):3 lc palette Commented Oct 23, 2017 at 17:36
  • Perfect! Thank you very much! I'd accept this as an answer if you put it as such. Commented Oct 23, 2017 at 18:31

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.