【问题标题】:gnuplot - plot both from a data file and a gnuplot function in a single imagegnuplot - 从数据文件和 gnuplot 函数在单个图像中绘制
【发布时间】:2022-10-23 14:24:22
【问题描述】:

我有以下sn-p:

set grid

set xlabel "Entropy"
set ylabel "Amortized work"
set xrange [-0.05:1.05]

set style line 1 linecolor rgb '#516db0' linetype 2 linewidth 5

f(x) = -1.3973 * x ** 2 + 1.3947 * x + 0.5796
F = '$-1.3973 x^2 + 1.3947 x + 0.5796$'

set terminal cairolatex pdf input size 700,700 color colortext
set key opaque box lc "black" linewidth 3

plot 'RatioVerboseData.dat', f(x) 

set output

数据文件RatioVerboseData.dat 如下所示:

0.93070 0.290710
0.94060 0.281450
0.95050 0.254771
0.96040 0.241656

当我使用 gnuplot 运行脚本时,它会输出:

plot 'RatioVerboseData.dat', f(x)
                              ^
cairolatex terminal cannot write to standard output
"EntropyVerboseData.plt", line 15: util.c: No error

我使用 gnuplot 4.6.7 和 MiKTeX-pdfTeX 4.10 (MiKTeX 22.7)

【问题讨论】:

    标签: plot gnuplot


    【解决方案1】:

    您需要指定一个输出文件。否则,gnuplot 会尝试写回输入终端 (stdout)。这对于某些终端类型是有意义的,例如“哑”终端,与具有自己的显示窗口的终端类型无关,e.b. “qt”,“wxt”。但它不适用于需要创建多个输出流然后将它们组合以生成最终文档的终端类型,该文档涵盖了大多数(全部?)LaTeX 终端类型。

    添加一行:

    set output "RatioVerboseData.tex"
    

    【讨论】:

    • 添加该行导致我遇到另一个困难:gnuplot 卡住了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-11
    • 1970-01-01
    相关资源
    最近更新 更多