I have a data file with 4-column data, the first three columns specify a point (x,y,z) and the fourth is either a 1, 2, or 3 - I want the point to be colored based on the value of the fourth column (i.e., if it's a 2, color the point red, if 3, green, if 1, blue)
Asked
Active
Viewed 2,622 times
4
-
Discrete color part: http://stackoverflow.com/questions/8717805/how-to-make-points-one-color-when-a-third-column-equals-zero-and-another-color – Ciro Santilli OurBigBook.com Oct 09 '15 at 13:42
1 Answers
5
set style line 1 lc rgb "red"
set style line 2 lc rgb "blue"
set style line 3 lc rgb "green"
splot 'datafile' u 1:2:3:4 lc variable

mgilson
- 300,191
- 65
- 633
- 696