关于乳胶:在Gnuplot(epslatex)中使用填充曲线时,如何去除未知的缝隙?

How to remove unknown slits when using filledcurve in Gnuplot (epslatex)?

我现在正在gnuplot 4.6补丁程序级别1中尝试使用filledcurve。下面显示了示例脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
set term epslatex
set output"figure.tex"

set xlabel"\\\\huge{x-axis}"
set ylabel"\\\\huge{y-axis
}"
set format xy"\\\\LARGE{%.0f}"
set xrange [0.0:10.0]
set yrange [0.0:100.0]
set xtics 2.0
set ytics 20.0
set xtics offset 0, -0.3

f1(x) = x**1
f2(x) = x**2
f3(x) = x**3

set nokey
plot '+' using 1:(f2($1)):(f3($1)) with filledcurve lt 1 lc rgb"gray60",\\
     '+' using 1:(f1($1)):(f2($1)) with filledcurve lt 1 lc rgb"gray40",\\
     '+' using 1:(0.0):(f1($1))    with filledcurve lt 1 lc rgb"gray20"

我不知道为什么,但是似乎酒吧之间有白色恼人的缝隙。即使我增加set samples的数量也不能摆脱它。

是否有去除这些缝隙的主意?

enter image description here


不幸的是,这是一个与相邻填充多边形的绘制有关的查看器问题,另请参见使用gnuplot pm3d和pdf输出或错误报告#1259 cairolatex pdf填充图案生成的图像中有问题的莫尔条纹。

在您的情况下,您可以使用解决方法:

using语句中只有两列时,该区域将绘制为闭合多边形,并且不显示这些工件(filledcurves closed)。因此,必须填充每个曲线和x1轴之间的区域(使用filledcurves x1)。

由于超过y范围的曲线剪切中存在错误,因此您必须自己剪切f3曲线(即使用f3($1) > 100 ? 100 : f3($1))。此错误已在开发版本中修复。

所以您的脚本是:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set term epslatex standalone
set output"figure.tex"

set xlabel"\\\\huge x-axis"
set ylabel"\\\\huge y-axis"
set format xy"\\\\LARGE %.0f"
set xrange [0.0:10.0]
set yrange [0.0:100.0]
set xtics 2.0
set ytics 20.0
set xtics offset 0, -0.3

f1(x) = x**1
f2(x) = x**2
f3(x) = x**3

set nokey
plot '+' using 1:(f3($1) > 100 ? 100 : f3($1)) with filledcurve x1 lt 1 lc rgb"gray60",\\
     '+' using 1:(f2($1)) with filledcurve x1 lt 1 lc rgb"gray40",\\
     '+' using 1:(f1($
1)) with filledcurve x1 lt 1 lc rgb"gray20"

set output
system('latex figure.tex && dvips figure.dvi && ps2pdf figure.ps')

结果(使用4.6.1):

enter image description here

还请注意,像\\huge这样的LaTeX命令不带参数,而是开关。测试例如\\huge{A}BC,这会使所有字母变大。通常,您必须使用{\\huge ABC}之类的括号来限制\\huge的范围,但是如果整个标签受到影响,则使用set xlabel"\\\\huge x-axis"就足够了。这不会改变您的情况,但在其他情况下可能会给您带来麻烦:)