使用 Adob​​e Reader PGFPLOTS 的打印问题

使用 Adob​​e Reader PGFPLOTS 的打印问题

我正在使用 PGFPLOTS 在我的论文中制作图表。当我使用 Adob​​e Reader 打印文档时,使用 PGFPLOTS 创建的一些图表(不是全部)中会出现一些额外的奇怪线条(在小框中)。当我使用不同的 PDF 阅读器(Foxit、Sumatra、Chrome 等网络浏览器)打印时没有问题。

我发现其他人也有同样的问题,而且都与 Adob​​e Reader 有关。但是,我找不到任何解决方案。事实上,如果有人使用 Adob​​e 打印文档,图表就会打印不正确。为了进行比较,我附上了打印的纸张和真实的图表。我使用的是最新版本的软件包。(\pgfplotsset{compat=1.18})。我需要你们的帮助,谢谢大家。

我把代码简化了很多。我还应该提一下,我尝试在两台不同的打印机上打印同一份文档。谢谢大家。

一个没有确切解决方案的类似问题:类似问题

简化代码(可重现):

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{external}
\tikzexternalize[prefix=TikzPDFs/,shell escape=-enable-write18]
\usepackage{color}

\begin{document}
\begin{figure}[h]
    \pgfplotsset{
        width=14cm,
        height=8.5cm,
        every axis plot/.append style={
        line width=0.9pt,
        },
        legend style={font=\footnotesize},
    }

\tikzsetnextfilename{bst_0model}
\begin{tikzpicture}
\begin{axis}[
mark options={solid,scale=1},
axis background/.style={fill=white},
xmin = 0, 
ymin = 0,
xmax=10,
ymax=90,
xlabel={Strain \%},
ylabel={Stress (MPa)},
legend cell align={left},
legend entries={Analytical Solution},
legend pos=south east
]

\addplot [
red,
mark=*,
mark size=2pt,
]coordinates {
(0,0)
(2,62.3)
(10,62.3)
};

\coordinate (insetPosition) at (rel axis cs:0.45,0.01);
 \end{axis}
 
\begin{axis}[ at={(insetPosition)},anchor={outer south east},
footnotesize,
mark options={solid,scale=1},
axis background/.style={fill=white},
xmin = 9.8, 
ymin =62,
xmax=10,
ymax=62.5,
xtick distance=0.1,
width=4cm
]

\addplot [
red,
mark=*,
mark size=2pt,
]coordinates {
(0,0)
(2,62.3)
(10,62.3)
};

\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}

我在 PDF 文件中看到的内容:

在此处输入图片描述

使用 Adob​​e Reader 打印出来的内容:

在此处输入图片描述

答案1

类似的问题实际上可以解决 MWE 的问题,但我不知道它是否适用于您的实际情况。我想您可以在实际情况中尝试类似的事情,将域限制为仅最后两个点,看看这是否有效。这看起来像是一个错误。我所做的是向第二个轴添加选项。

\begin{axis}[at={(insetPosition)},anchor={outer south east},
footnotesize,
mark options={solid,scale=1},
axis background/.style={fill=white},
restrict x to domain = 2:10, % add this
restrict y to domain = 62:63, % add this
xmin =9.8, 
ymin =62,
xmax=10,
ymax=62.5,
%xtick distance=0.1, % don't needed
width=4cm
]

相关内容