从 gnuplot 的图例中删除东西

Remove thing from gnuplot's legend

我必须使用 gnuplot 绘制三个隐式函数,我使用这个:

set contour
set cntrparam levels discrete 0
set view map
unset surface
set isosamples 1000,1000
set xrange [-5:7]
set yrange [-15:15]
set xlabel "x"
set ylabel "y"
splot y**2-x**3+15*x-13 t "t1", y**2-x**3+15*x-sqrt(4.*15.**3/27.) t "singular", y**2-x**3+15*x-30 t "t2", y**2-x**3+15*x-13 t "t3"

输出是这样的:

程序正在图例中写入表面级别的 0,但我只想将 title 参数传递给 splot 命令。由于三个表面在不同的高度实际上是相同的,我可以更改 set cntrparam... 线来绘制其中的三个,但我想要做的是删除数字并使其只写文本。我该怎么做?

您不能直接使用任何文本操作等高线级别标签。只需使用 set table... 将等高线数据写入临时文件,然后像往常一样绘制此数据文件。在这里,您现在可以使用 index:

区分不同的轮廓级别
set contour
set cntrparam levels discrete 0
set view map
unset surface
set isosamples 1000,1000
set xrange \[-5:7\]
set yrange \[-15:15\]
set xlabel "x"
set ylabel "y"

set table 'contour.dat'
splot y**2-x**3+15*x-13 t "t1", y**2-x**3+15*x-sqrt(4.*15.**3/27.) t "singular", y**2-x**3+15*x-30 t "t2", y**2-x**3+15*x-13 t "t3"
unset table

set style data lines
plot 'contour.dat' index 0 title 't1', '' index 1 title 'singular', '' index 2 title 't2', '' index 3 title 't3'