Проблема в том, что gnuplot требует пустой строки после каждой строки (матрицы) (например, когда изменяется значение столбца 1).Таким образом, вы можете вставить пустые строки вручную или с помощью внешнего инструмента или позволить gnuplot сделать это.Вы выводите свои данные в фиктивную таблицу (блок данных), а затем распечатываете их в другой блок данных и вставляете пустую строку, когда значение столбца 1 изменяется.Немного громоздко, но это работает.Требуется gnuplot> = 5.2.
Код:
### contour plot, addding empty lines to raw data
reset session
set contour base
set pm3d
set cntrparam level 10
unset surface
set view map
set size 0.9,0.9 # shrink the size a little otherwise colorbar numbers will be outside canvas
### insert empty lines everytime when column 1 changes its value
set table $Dummy # initialize a table (datablock) named $Dummy
plot "relax.txt" u 1:2:3 with table # plot datafile into a datablock $Dummy
unset table # close the table
set print $Data # set print output to datablock $Data
check="" # initialize your comparison variable to empty string
do for [i=1:|$Dummy|] { # loop the datablock $Dummy by lines
if (check ne word($Dummy[i],1)) { print "\n" } # comparison: if values are not equal insert a line
print $Dummy[i] # print current line to datablock $Data
check = word($Dummy[i],1) # assign latest value to variable "check"
}
set print # close the datablock $Data
splot $Data u 1:2:3 w l notitle
### end of code
Результат:
![enter image description here](https://i.stack.imgur.com/mvviy.png)