在 gnuplot 中仅更改一个数据点的颜色

Change color of only one data point in gnuplot

我正在 gnuplot 中制作 gif,我将数据分成块。我需要这些点是白色的,除了 只是 每个数据块的第一行,这将是一个橙色点。

目前我的代码是:

#...
do for [i=0:int(STATS_blocks-1)]{
plot "positions.txt" index i pt 7 ps 0.5 lc 'white' title "t = ".((i+1)*200)." Myr"
}

如您所见,这会将每个数据点绘制为白色,包括第一行。

已编辑以显示变量点数

如果我正确理解你的数据格式:

set linetype 11 lc "orange"
set linetype 12 lc "white"

set style data points
do for [i=0:N] {
  plot "positions.txt" index i using 1:2:(column(0)>0 ? 0.5 : 2.0):(column(0)>0 ? 12 : 11) pt 7 ps variable lc variable
}

可变颜色(如果使用)总是取自最后的 using 列。其他变量属性从那里开始工作。