我想在Gnuplot中绘制带有X、Y和颜色的点,应该如何操作?
plot "./file.dat" u 1:2:3 with points palette
文件file.dat包含您的数据,第一列是x轴,第二列是y轴,第三列是颜色。
plot "file.dat" using 1:2:3 with points color rgb($4,$5,$6)
将从数据文件的第4、5和6列中获取每个点的颜色的RGB分量。或者,
plot "file.dat" using 1:2:3 with points color $4
将会读取数据文件中第四列的数字(称其为n),并使用调色板中的第n个颜色绘制每个点。如果n不是整数,比如2.5,则它会在RGB空间中给出介于颜色2和颜色3之间的颜色。