如何在Gnuplot中绘制三维图形横截面上的离散数据

如何在Gnuplot中绘制三维图形横截面上的离散数据,gnuplot,Gnuplot,我想在z=0的横截面上绘制stp199inf2.dat中写入的离散数据,其中还绘制了函数c1和c2。 我现在真的需要帮助 -------------------stp199inf2.dat---------------------- 1.037663 0.042694 0.0 0.071479 1.018838 0.0 0.871717 0.475405 0.0 0.909571 0.456881 0.0 0.996505 0.096337 0.0 使用未设置的曲面也不会绘制点。因此,必须在

我想在z=0的横截面上绘制stp199inf2.dat中写入的离散数据,其中还绘制了函数c1和c2。 我现在真的需要帮助


-------------------stp199inf2.dat----------------------

1.037663 0.042694 0.0
0.071479 1.018838 0.0
0.871717 0.475405 0.0
0.909571 0.456881 0.0
0.996505 0.096337 0.0


使用
未设置的曲面
也不会绘制点。因此,必须在打印点之前设置曲面

对代码的其他一些注释:

  • 如果所有内容都在一个绘图中,则应使用带有逗号分隔的调用的单个
    splot
    命令
  • 在这种情况下,必须使用选项
    nosurface
    取消设置前三个打印的曲面
  • 必须使用选项
    nocontour
    取消设置点打印的等高线
  • 如果使用
    set view map
    而不是
    set view 0,0
    ,则不会绘制重叠的ZTIC标签
  • 因此,一个合理的脚本可以如下所示:

    set termoption font"Times New Roman,12"
    set multiplot
    
    c1(x,y) = x**2 + y**2 -1 - 0.1*cos(16*atan(x/y))
    c2(x,y) = (x-0.5)**2 + (y-0.5)**2 -0.5
    
    C=0.7
    set xrange[0:1.2]
    set yrange[0:1.2]
    
    set xlabel "f1"
    set ylabel "f2"
    set key outside
    
    set isosamples 300,300
    set contour base
    set cntrparam levels discrete  0.0
    set size square
    set view map
    
    splot c1(x,y)  lt -1 lw 1 title "" nosurface,\
          c2(x,y) lt -1 lw 1 title "" nosurface,\
          c1(x,y) lt 3 lw 2.5 title "True Pareto Front" nosurface,\
          'stp199inf2.dat' lt 4 ps 3 pt 7 nocontour title ""
    
    unset multiplot
    
    4.6.3的输出为:


    我不确定如何最好地处理轮廓关键点条目。当我发现问题时,我会更新答案。

    你的问题/问题到底是什么?你能解释一下你从你的代码中得到了什么样的结果,以及这与你期望的有什么不同吗?也许你可以在某个地方上传一个图并在这里共享一个链接?
    set termoption font"Times New Roman,12"
    set multiplot
    
    c1(x,y) = x**2 + y**2 -1 - 0.1*cos(16*atan(x/y))
    c2(x,y) = (x-0.5)**2 + (y-0.5)**2 -0.5
    
    C=0.7
    set xrange[0:1.2]
    set yrange[0:1.2]
    
    set xlabel "f1"
    set ylabel "f2"
    set key outside
    
    set isosamples 300,300
    set contour base
    set cntrparam levels discrete  0.0
    set size square
    set view map
    
    splot c1(x,y)  lt -1 lw 1 title "" nosurface,\
          c2(x,y) lt -1 lw 1 title "" nosurface,\
          c1(x,y) lt 3 lw 2.5 title "True Pareto Front" nosurface,\
          'stp199inf2.dat' lt 4 ps 3 pt 7 nocontour title ""
    
    unset multiplot