0

I Have a dataset with a whole bunch of rows corresponding to points (x,y) on the plane. I want to plot this collection of points with a gradient so the first point in the list is blue, and as it plots more and more points from the list it shifts to red.

Is there any way to do this in gnuplot? Any advice would be appreciated.

Ltoll
  • 167
  • 6

1 Answers1

2

You can use the linecolor palette z option to do this. For example, if you have a datafile test.dat that looks like

1   1
2   2
3   3
4   4

then you can do

unset key
set palette defined ( 0 "blue", 1 "red" )
plot "test.dat" u 1:2:0 w p pt 7 ps 3 lc palette z

enter image description here

user8153
  • 4,049
  • 1
  • 9
  • 18