不要在gnuplot的splot中绘制像素边界。

huangapple go评论82阅读模式
英文:

Do not draw pixel borders in gnuplot splot

问题

我正在使用splot绘制一个表面图;数据在一个具有相当小像素的规则网格上定义。在屏幕上看起来没问题,但当我将其写入PDF时,每个像素周围都出现了白色网格线,看起来很糟糕(请参见下面的图像)。我找不到关闭它们的方法,有人能给我建议吗?

要生成下面的图像的(简化)代码:

reset
set multiplot layout 1,3 margins 0.05,0.9,0.05,0.95 spacing 0.09,0

set view map scale 1
unset surface
set colorbox
set pm3d
set palette

splot "Task9_2_final.dat" u 1:2:3 notitle
splot "Task9_2_final.dat" u 1:2:5 notitle
splot "Task9_2_final.dat" u 1:2:6 notitle

然后生成PDF文件的步骤如下:

set term pdf size 30cm, 10cm

Terminal type is now 'pdfcairo'
Options are ' transparent enhanced fontscale 0.5 size 30.00cm, 10.00cm '

set out "../figures/Task9_2.pdf"
load "Task9_2.gpl"
set term pop

(我保留了gnuplot的输出,以防它有帮助)。

不要在gnuplot的splot中绘制像素边界。

英文:

I am plotting a surface using splot; the data are defined on a regular grid with fairly small pixels. On screen it looks fine, but when I write it to a pdf there are white grid lines appearing around each pixel which look horrible (see image below). I have not found a way to turn them off, can anyone advise me please?

(Reduced) code to produce the image below:

reset
set multiplot layout 1,3 margins 0.05,0.9,0.05,0.95 spacing 0.09,0

set view map scale 1
unset surface
set colorbox
set pm3d
set palette

splot "Task9_2_final.dat" u 1:2:3 notitle
splot "Task9_2_final.dat" u 1:2:5 notitle
splot "Task9_2_final.dat" u 1:2:6 notitle

And to get the PDF I do:

gnuplot> set term pdf size 30cm, 10cm

Terminal type is now 'pdfcairo'
Options are ' transparent enhanced fontscale 0.5 size 30.00cm, 10.00cm '

gnuplot> set out "../figures/Task9_2.pdf"
gnuplot> load "Task9_2.gpl"
gnuplot> set term pop

(Where I've left the gnuplot output in, in case it is helpful).

不要在gnuplot的splot中绘制像素边界。

答案1

得分: 1

这是由许多PDF查看器中的差劲抗锯齿引入的工件。如果您的gnuplot版本足够新,您可以通过重新跟踪网格中每个“像素”的边界来解决查看器的问题。执行此操作的命令是

 set pm3d border retrace

我相信这个命令首次出现在gnuplot 5.4的补丁级别3中。在较早的gnuplot版本中,可以通过一个未记录的特殊线型来实现相同的效果(行为不保证)

set pm3d border lt -6
英文:

This is an artifact introduced by poor antialiasing in many pdf viewers. If your gnuplot version is sufficiently recent, you can work around the viewer problem by retracing the border of each "pixel" in the grid. The command to do this is

 set pm3d border retrace

I believe this command was first introduced in gnuplot 5.4 patchlevel 3. In earlier gnuplot versions the same thing could be achieved by an undocumented special linetype (behavior not guaranteed)

set pm3d border lt -6

huangapple
  • 本文由 发表于 2023年7月10日 22:15:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654628.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定