具有边界的时间序列填充模式(tikz pgfplots)会生成损坏的PDF

具有边界的时间序列填充模式(tikz pgfplots)会生成损坏的PDF

我使用了另一篇文章中的答案,但使用建议的代码生成的 PDF 似乎已损坏。这篇文章提到了这个问题:具有边界的时间序列填充模式(tikz pgfplots)

建议使用以下代码的答案:

\documentclass[border=2]{standalone}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.12}
\usetikzlibrary{patterns}

\pgfplotstableread{
temps   y_h y_h__inf    y_h__sup    y_f y_f__inf    y_f__sup    y_dd

100     0.0000      0.0000      0.0000      0.0001      0.0001      0.0001      0.0001
101     0.1713      0.0000      0.3445      0.3445      0.3445      0.3445      0.3445
102     0.5007      0.0000      0.5633      0.5633      0.5633      0.5633      0.5633
103     0.6984      0.5633      0.7615      0.7513      0.6691      0.7615      0.7615
104     0.7664      0.0000      0.8981      0.8544      0.5633      0.8981      0.8981
105     0.8766      0.7615      0.9388      0.9157      0.8395      0.9660      0.9660
106     0.9225      0.6691      0.9916      0.9317      0.7615      0.9916      0.9916
107     0.9334      0.8395      0.9916      0.9016      0.6691      0.9962      0.9986
108     0.8463      0.5633      0.9986      0.8914      0.6691      0.9916      0.9999
109     0.8725      0.4521      0.9999      0.9112      0.7615      0.9916      1.0000
110     0.8306      0.0000      1.0000      0.8820      0.6691      0.9962      1.0000

}{\table}

\begin{document}
\begin{tikzpicture}

\begin{axis}
% y_h confidence interval
\addplot [stack plots=y, fill=none, draw=none, forget plot]   table [x=temps, y=y_h__inf]   {\table} \closedcycle;
\addplot [stack plots=y, pattern=north west lines,pattern color=red!50, opacity=0.4, draw opacity=0, area legend]   table [x=temps, y expr=\thisrow{y_h__sup}-\thisrow{y_h__inf}]   {\table} \closedcycle;
% subtract the upper bound so our stack is back at zero
\addplot [stack plots=y, stack dir=minus, forget plot, draw=none] table [x=temps, y=y_h__sup] {\table};

% y_f confidence interval
\addplot [stack plots=y, fill=none, draw=none, forget plot]   table [x=temps, y=y_f__inf]   {\table} \closedcycle;
\addplot [stack plots=y, , pattern=north east lines,pattern color=blue!50, opacity=0.4, draw opacity=0, area legend]   table [x=temps, y expr=\thisrow{y_f__sup}-\thisrow{y_f__inf}]   {\table} \closedcycle;

% the line plots (y_h and y_f)
\addplot [stack plots=false, very thick,red]  table [x=temps, y=y_h]   {\table};
\addplot [stack plots=false, very thick,blue]  table [x=temps, y=y_f]   {\table};
\addplot [stack plots=false, very thick,green]  table [x=temps, y=y_dd]   {\table}; % smooth
\end{axis}

\end{tikzpicture}
\end{document}

但是,有一些奇怪的“行为”:我使用 TexMaker 编译我的 tex 文件。当使用您建议的代码并在 TexMaker 中编译时,应用程序内置的查看器什么都不显示(只有一个空白)。现在,使用 Adob​​e Viewer 打开创建的 PDF,图表看起来正确。使用 Nitro PDF 打开它会产生非常奇怪的颜色和填充,放大或缩小时会一直变化。

该代码必定会以某种方式导致 PDF 文件损坏。

以下命令

\pgfplotsset{compat=1.12}

也不被接受。TexMaker 回应:

! Package pgfkeys Error: Choice '1.12' unknown in choice key '/pgfplots/compat/ anchors'. I am going to ignore this key."

您知道可能是什么问题吗?

相关内容