PGGFlots 循环列表在每个循环后跳过第一个定义

PGGFlots 循环列表在每个循环后跳过第一个定义

我在 PGFPlots 中创建自创循环列表时遇到了一些问题。如您所见,每次运行循环列表后,绘图都会跳过循环列表的第一个定义。是否存在我没​​有意识到的编码错误?

mycyclelist使用时也会出现同样的错误cycle multi list

\documentclass{standalone}

\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{pgf, tikz, pgfplots}

\definecolor{UniBlau}{cmyk}{1,0.7,0,0}
\definecolor{UniGruen}{cmyk}{0.6,0,1,0}
\definecolor{UniOrange}{cmyk}{0,0.3,1,0}
\definecolor{UniRot}{cmyk}{0.4,1,0,0}

\pgfplotscreateplotcyclelist{mycyclelist}{
{UniBlau, line width = 2pt},
{UniGruen, line width = 2pt},
{UniOrange, line width = 2pt},
{UniRot, line width = 2pt},
{UniBlau!50!UniGruen, line width = 2pt},
{UniGruen!50!UniOrange, line width = 2pt},
{UniOrange!50!UniRot, line width = 2pt},
{UniRot!50!UniBlau, line width = 2pt},
}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name = mycyclelist]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

希望你能帮助我。

非常感谢!

答案1

通过删除最后的 稍微改变一下循环的定义,,这会为第 9 行引入一个空的样式,并添加%稳定性(没有它们,我的系统就无法编译)你会得到

\pgfplotscreateplotcyclelist{mycyclelist}{%
  {UniBlau, line width = 2pt},%
  {UniGruen, line width = 2pt},%
  {UniOrange, line width = 2pt},%
  {UniRot, line width = 2pt},%
  {UniBlau!50!UniGruen, line width = 2pt},%
  {UniGruen!50!UniOrange, line width = 2pt},%
  {UniOrange!50!UniRot, line width = 2pt},%
  {UniRot!50!UniBlau, line width = 2pt}%
}

在此处输入图片描述

相关内容