von esdd » Mi 24. Apr 2019, 10:46
Du lädst sowohl pgfplots als auch die colorbrewer Bibliothek zwei Mal, dafür fehlt das Setzen von compat direkt nach dem Laden des Pakets.
Du könntest zum einen direkt die schon definierte color list verwenden:
\documentclass[a4paper]{scrbook}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}% <- aktuelle Version ist 1.16
\pgfplotsset{
cycle list/.define={my marks}{
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=*\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=star\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=square\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=+\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=triangle\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=x\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=pentagon\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=o\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=diamond\\
},
cycle multiindex* list={
my marks\nextlist
color list\nextlist
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend style={at={(1.03,0.5)}, anchor=west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot {rnd};\addlegendentry{1}
\addplot {rnd-1};\addlegendentry{2}
\addplot {rnd-2};\addlegendentry{3}
\addplot {rnd-3};\addlegendentry{4}
\addplot {rnd-4};\addlegendentry{5}
\addplot {rnd-5};\addlegendentry{6}
\addplot {rnd-6};\addlegendentry{7}
\addplot {rnd-7};\addlegendentry{8}
\addplot {rnd-8};\addlegendentry{9}
\addplot {rnd-9};\addlegendentry{10}
\addplot {rnd-10};\addlegendentry{11}
\end{axis}
\end{tikzpicture}
\end{document}
Zum anderen kannst Du natürlich genauso eine eigene Liste mit Farben erstellen, wie Du es für die Marker getan hast:
\documentclass[a4paper]{scrbook}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}% <- aktuelle Version ist 1.16
\pgfplotsset{
cycle list/.define={my marks}{
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=*\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=star\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=square\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=+\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=triangle\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=x\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=pentagon\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=o\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=diamond\\
},
cycle list/.define={my colors}{red,gray,blue,green!70!black},
cycle multiindex* list={
my marks\nextlist
my colors\nextlist
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend style={at={(1.03,0.5)}, anchor=west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot {rnd};\addlegendentry{1}
\addplot {rnd-1};\addlegendentry{2}
\addplot {rnd-2};\addlegendentry{3}
\addplot {rnd-3};\addlegendentry{4}
\addplot {rnd-4};\addlegendentry{5}
\addplot {rnd-5};\addlegendentry{6}
\addplot {rnd-6};\addlegendentry{7}
\addplot {rnd-7};\addlegendentry{8}
\addplot {rnd-8};\addlegendentry{9}
\addplot {rnd-9};\addlegendentry{10}
\addplot {rnd-10};\addlegendentry{11}
\end{axis}
\end{tikzpicture}
\end{document}
In beiden Fällen brauchst Du dann die colorbrewer Bibliothek nicht.
Du lädst sowohl [tt]pgfplots[/tt] als auch die [tt]colorbrewer[/tt] Bibliothek zwei Mal, dafür fehlt das Setzen von [tt]compat[/tt] direkt nach dem Laden des Pakets.
Du könntest zum einen direkt die schon definierte [tt]color list[/tt] verwenden:
[code]\documentclass[a4paper]{scrbook}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}% <- aktuelle Version ist 1.16
\pgfplotsset{
cycle list/.define={my marks}{
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=*\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=star\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=square\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=+\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=triangle\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=x\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=pentagon\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=o\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=diamond\\
},
cycle multiindex* list={
my marks\nextlist
color list\nextlist
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend style={at={(1.03,0.5)}, anchor=west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot {rnd};\addlegendentry{1}
\addplot {rnd-1};\addlegendentry{2}
\addplot {rnd-2};\addlegendentry{3}
\addplot {rnd-3};\addlegendentry{4}
\addplot {rnd-4};\addlegendentry{5}
\addplot {rnd-5};\addlegendentry{6}
\addplot {rnd-6};\addlegendentry{7}
\addplot {rnd-7};\addlegendentry{8}
\addplot {rnd-8};\addlegendentry{9}
\addplot {rnd-9};\addlegendentry{10}
\addplot {rnd-10};\addlegendentry{11}
\end{axis}
\end{tikzpicture}
\end{document}[/code]
Zum anderen kannst Du natürlich genauso eine eigene Liste mit Farben erstellen, wie Du es für die Marker getan hast:
[code]\documentclass[a4paper]{scrbook}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}% <- aktuelle Version ist 1.16
\pgfplotsset{
cycle list/.define={my marks}{
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=*\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=star\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=square\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=+\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=triangle\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=x\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=pentagon\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=o\\
every mark/.append style={solid,fill=\pgfkeysvalueof{/pgfplots/mark list fill}},mark=diamond\\
},
cycle list/.define={my colors}{red,gray,blue,green!70!black},
cycle multiindex* list={
my marks\nextlist
my colors\nextlist
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend style={at={(1.03,0.5)}, anchor=west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot {rnd};\addlegendentry{1}
\addplot {rnd-1};\addlegendentry{2}
\addplot {rnd-2};\addlegendentry{3}
\addplot {rnd-3};\addlegendentry{4}
\addplot {rnd-4};\addlegendentry{5}
\addplot {rnd-5};\addlegendentry{6}
\addplot {rnd-6};\addlegendentry{7}
\addplot {rnd-7};\addlegendentry{8}
\addplot {rnd-8};\addlegendentry{9}
\addplot {rnd-9};\addlegendentry{10}
\addplot {rnd-10};\addlegendentry{11}
\end{axis}
\end{tikzpicture}
\end{document}[/code]
In beiden Fällen brauchst Du dann die [tt]colorbrewer[/tt] Bibliothek nicht.