You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gnuplot Cairolatex终端生成异常结果求助

Gnuplot脚本生成异常PNG文件问题求助

我编写了如下Gnuplot脚本:

# set terminal cairolatex size 5.0cm,5.0cm color
# set output 'RatioVerbose.tex'

set grid
# set key font "Times New Roman,12"

set style line 1 \
    linecolor rgb '#a82828' \
    linetype 1 linewidth 3 \
    pointtype 5 pointsize 1.5

set xlabel "Entropy"
set ylabel "Actual work / theoretical work"
set xrange [-0.05:1.05]
set yrange [0:1.4]

f(x) = -1.3598 * x ** 2 + 1.3493 * x + 0.6590

set style line 2 lt 1 lw 3 linecolor rgb '#386dc2'

set terminal cairolatex png font ",12" fontscale 0.7 size 5.0cm,5.0cm

set output 'VerboseRatio.png'

plot 'RatioVerboseData.dat' with linespoints linestyle 1 notitle, \
      f(x) w l ls 2 title '$-1.3598x^2 + 1.3493x + 0.6590$'

# set terminal tikz size 5.0cm,5.0cm
# set terminal png size 700,700 enhanced font "Monospaced,13"
# set output 'RatioVerbose.png'

set output
replot
exit

但运行后生成了异常的PNG文件:
异常PNG文件

已尝试解决该问题许久但未成功,推测可能是脚本中缺少某些代码,恳请各位提供帮助。

补充说明:已附上Cairolatex生成的实际PNG文件。


内容的提问来源于stack exchange,提问作者coderodde

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 19:48:25