pdfcairo终端

时间:2018-02-01 02:43:08

标签: pdf gnuplot

我发现最新的gnuplot 5.2上的pdfcairo终端质量很差。我要测试的非常简单的脚本是:

reset
set terminal pdfcairo font ", 12"
set output 'graph.pdf' 

set samples 10000
unset key

plot sin(x**2) w l

reset
set term wxt
set out

out pdf是: I did maximal zoom in pdf viewer

人们可以看到奇怪的噱头。如果我们增加样本数量,图片会更糟。这对我来说很奇怪,因为我认为随着样本数量的增加,曲线变得更加平滑。

从wxt终端使用导出到pdf时会出现相同的行为。但是如果我设置qt终端然后导出为pdf,那么使用相同的set samples 10000可以更好地获得输出曲线: Not ideal, but much much better

发生了什么事? pdfcairo终端缺乏抗锯齿功能?

修改

我找到了关于同一问题here的讨论。可以从该线程中获取脚本并将samples更改为更高的值,例如10000.当我们放大图时,这会导致“逐步”线而不是平滑曲线。

1 个答案:

答案 0 :(得分:1)

It looks like some artefact of the line endings and joins (triggered by the mitering effect of the default butt style) of the elementary line segments within the plot due to finite line width. In order to mitigate this, it seems to help to use:

set terminal pdfcairo rounded font ",12"

i.e., to prescribe rounded line endings/joins instead of the default butt.