Gnuplot splot colors based on the fourth column of the data file

I have a data file with 4-column data, the first three columns indicate the point (x, y, z), and the fourth - either 1, 2, or 3 - I want the point to be colored based on the value of the fourth column (i.e. e. if it is 2, the color of the dot is red, if 3, green, if 1, blue)

+4
source share
1 answer
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 
+5
source

All Articles