【问题标题】:Remove thing from gnuplot's legend从 gnuplot 的传说中删除东西
【发布时间】:2015-05-04 15:33:31
【问题描述】:

我必须使用 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... 线来绘制它们三个,但我想要做的是删除数字并让它只写文本。我该怎么做?

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    您不能使用任何文本直接操作轮廓级别标签。只需使用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'
    

    【讨论】:

      猜你喜欢
      • 2015-01-14
      • 1970-01-01
      • 1970-01-01
      • 2016-02-23
      • 2023-03-27
      • 2014-06-25
      • 2014-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多