pdf中令人不安的文物 [英] disturbing artifacts in pdf

查看:79
本文介绍了pdf中令人不安的文物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用曲线填充图时,我遇到了问题.在填充区域之间,似乎存在间隙".但是,这些伪像不会出现在打印件上,而是取决于查看器和缩放选项.在Gnuplot中,我使用eps终端,eps文件看起来很棒,但是当我转换为pdf时出现了这些行.转换既可以在绘图后直接完成,也可以在将乳胶文档从dvi转​​换为pdf时进行.由于当今大多数文档都在此处显示,因此这是一个问题.当我直接在Gnuplot中使用pdfcairo终端时,也会出现此问题,因此这并不是单独的转换(尝试过epstopdf和ps2pdf)引起的.

I'm struggling with a problem when making plots with filledcurves. Between the filled areas, there seems to be a "gap". However, these artifacts do not appear on the print, but depend on the viewer and zoom-options. In Gnuplot I use the eps terminal, the eps-files look great, but the lines appear when I'm converting to pdf. The conversion it either done directly after plotting or when converting the latex-document from dvi to pdf. As most of the documents are here on the display nowadays, this is an issue. The problem also appears when I'm directly using the pdfcairo terminal in Gnuplot, so it's not caused by the conversion (tried epstopdf and ps2pdf) alone.

我附上了显示在"acroread"(其他pdf查看器中的相同问题)上的图的SCREENSHOT.

I attached a SCREENSHOT of a plot displayed in "acroread" (same problem in other pdf-viewers).

有人知道如何消除它,但要保持图形矢量化吗?

Has anybody an idea how to get rid of it but keeping the graphic vectorized?

推荐答案

我只是遇到了同样的问题.显然,两条曲线之间的填充 作为一组不完全相互接触的多边形来完成,因此 在某些PDF查看器上可见的细白线.

I just ran into the same issue. Apparently the filling between two curves is done as a set of polygons that do not exactly touch one another, thus the thin white lines visible on some PDF viewers.

解决此问题的一种方法是绘制这些多边形边界.第一的 在gnuplot中定义最小和最大函数:

One way to fix the issue is to draw over these polygon boundaries. First define min and max functions in gnuplot:

min(x, y) = x < y ? x : y
max(x, y) = x > y ? x : y

然后,假设数据文件"的第1列包含您的x值, 该列2和3包含曲线2和3的y值,请输入:

Then, assuming that column 1 of "datafile" contains your x values and that columns 2 and 3 contain the y values of curves 2 and 3, write:

plot "datafile" using 1:2:3 with filledcurves lc rgb "gray", \
"" using 1:2:(min($2, $3)):(max($2, $3)) with yerrorbars ps 0 lt 1 \
lc rgb "gray" lw 0.5

第一个绘图指令以灰色填充曲线之间的空间. 第二个绘图指令在每个位置绘制大小为零(ps 0)的点 曲线(2)的x值(1),细(lw 0.5),连续(lt 1),灰色 (lc rgb灰色"),垂直误差线(yerrorbars)从下到下 曲线2和3中的较高者.

The first plot instruction fills the spaces between the curves in gray. The second plot instruction draws points of zero size (ps 0) at each x value (1) on curve (2) with thin (lw 0.5), continuous (lt 1), gray (lc rgb "gray"), vertical errorbars (yerrorbars) from the lower to the higher of curves 2 and 3.

这包括白线.为了获得最佳结果,您可能需要 用棒的厚度(例如,lw 0.6,lw 0.2)进行实验.

This covers the white lines. To get best results you may need to experiment with the thickness of the bars (e.g., lw 0.6, lw 0.2).

这篇关于pdf中令人不安的文物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆