我想在z = 0的横截面上绘制用stp199inf2.dat写的离散数据,其中还绘制了函数c1和c2。 我现在真的需要帮助。
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 tics font"Times New Roman,12"
set xlabel "f1"
set ylabel "f2"
set xlabel font "Times New Roman, 12"
set ylabel font "Times New Roman, 12"
set key font "Times New Roman, 12"
set key right top
set isosamples 300,300
set contour base
set cntrparam levels discrete 0.0
set nosurface
set size square
set view 0,0,
splot c1(x,y) lt -1 lw 1 title ""
splot c2(x,y) lt -1 lw 1 title ""
splot c1(x,y) lt 3 lw 2.5 title "True Pareto Front"
splot './gnuplot_plot/stp199inf2.dat' lt 4 ps 3 pt 7
pause -1
------------------- 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
答案 0 :(得分:0)
使用unset surface
时,也不会绘制点数。因此,您必须在绘制点之前设置曲面。
您的代码的其他一些评论:
splot
命令。nosurface
取消设置前三个图表的曲面。nocontour
取消设置点图的轮廓。set view map
代替set view 0,0
,则重叠的zticlabels不会是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
。绘制。因此,合理的脚本可能如下所示:
{{1}}
4.6.3的输出是:
我不确定如何最好地处理轮廓键输入。当我找到答案时,我会更新答案。