Gnuplot filledcurves with palette

后端 未结 6 997
有刺的猬
有刺的猬 2020-12-29 11:09

I have been trying to change the fillstyle for the filledcurves option in gnuplot so that the fill colour represents the difference between the two curves on a 2-dimensional

6条回答
  •  春和景丽
    2020-12-29 11:41

    Yet Another Solution

    If the pm3d 2D map is allowed without filledcurves, then the following code could be used to achieve this

    In the data processing part, the grid data for splot is constructed from the original input data. The color of the fill area is determined by the z-value given for splot.

    set table $first
    plot "test.dat" using 1:2:($3-$2) with table
    set table $second
    plot "test.dat" using 1:3:($3-$2) with table
    unset table
    
    set print $data
    do for [i=1:|$first|] {
      print $first[i]
      print $second[i]
      print ""
    }
    set print
    
    set yrange [-2:2]
    set palette define (-1 "skyblue", 0 "gray90", 1 "pink")
    
    splot $data using 1:2:3 with pm3d 
    

提交回复
热议问题