チャート内の複数の線を区別するにはどうすればいいですか?

チャート内の複数の線を区別するにはどうすればいいですか?

多数の(実際には 10 本の)異なる色の線を含むグラフを作成します(例を参照)。異なる線をできるだけ簡単に区別できるようにしたいと考えています。

例

私が考えているいくつかの可能性は次のとおりです:

  • 最も異なる色を取る
  • 明るい色は避けてください(例:黄色 - 印刷物では線が見えにくい)
  • パターンを使用する(破線、点線、異なる破線パターン) TikZ: 定義済みのダッシュパターンの値を取得する
  • 異なる厚さを使用する(これは良い考えではないと思います)

このタスクに関するベストプラクティス、ルール、ガイドはありますか?

私のサンプルコード:

\documentclass[border=5mm] {standalone}
\usepackage{pgfplots, pgfplotstable}
\begin{document}
\pgfplotstableread[col sep=&, header=true]{
description&A&B&C&D&E&F&G&H&I&K
2009&46&0&33&3&0&74&3&7&2&7
2010&35&0&22&1&0&90&2&5&3&3
2011&38&0&33&3&1&77&1&9&2&8
2012&25&0&15&0&4&55&4&5&0&1
2013&18&0&8&0&0&46&5&4&0&3
2014&37&0&54&1&3&54&5&12&10&2
2015&29&0&63&8&1&77&0&8&7&5
}\datatableentry
\begin{tikzpicture}
\begin{axis}[
  title={My Chart},
  enlarge y limits ={value=0.2,upper},
  xtick=data,
  xticklabels ={2009,2010,2011,2012,2013,2014,2015},  
  x tick label style={rotate=-45,anchor=west,font=\tiny},
  legend style={font=\tiny,legend pos=north west,legend cell align=left},
]
\addlegendentry{A};
\addplot [color=blue] table [y=A, x expr=\coordindex] {\datatableentry};
\addlegendentry{B};
\addplot [color=cyan] table [y=B, x expr=\coordindex] {\datatableentry};
\addlegendentry{C};
\addplot [color=gray] table [y=C, x expr=\coordindex] {\datatableentry};
\addlegendentry{D};
\addplot [color=yellow] table [y=D, x expr=\coordindex] {\datatableentry};
\addlegendentry{E};
\addplot [color=green] table [y=E, x expr=\coordindex] {\datatableentry};
\addlegendentry{F};
\addplot [color=lime] table [y=F, x expr=\coordindex] {\datatableentry};
\addlegendentry{G};
\addplot [color=black,loosely dashed] table [y=G, x expr=\coordindex] {\datatableentry};
\addlegendentry{H};
\addplot [color=red,densely dashed] table [y=H, x expr=\coordindex] {\datatableentry};
\addlegendentry{I};
\addplot [color=blue,dotted] table [y=I, x expr=\coordindex] {\datatableentry};
\addlegendentry{K};
\addplot [color=cyan,dashed] table [y=K, x expr=\coordindex] {\datatableentry};
\end{axis}
\end{tikzpicture}
\end{document}

免責事項:この質問がhttp://graphicdesign.stackexchange.com主な問題は設計上の問題ですが、解決策は Tikz で必要です。

答え1

デザインの観点から、最善の方法が何であるかは言えません。ただし、同様のケースで私が行ったことを色とマークを使用して示すことはできます。

\documentclass{standalone}
\usepackage{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}
  \begin{semilogxaxis}
    [
    width=\figwidth,
    height=0.75*\figwidth,
    scale only axis,
    font=\tiny,
    xmin=1, xmax=5000, xlabel={Energy [\si{\kilo\electronvolt}]},
    ymin=0, ymax=2.5, ylabel={Cross Section [\si{\angstrom\squared}]},
    log base 10 number format code/.code={ \pgfmathparse{10^(#1)}\num[round-mode=places, round-precision=0]{\pgfmathresult} },
    yticklabel={ \pgfmathparse{\tick*1}\num[round-mode=places,round-precision=1]{\pgfmathresult} },
    minor x tick num=9, minor y tick num=1,
    every tick/.append style={color=black},
    tick pos=left,
    legend style={draw=none, fill=none, inner ysep=0pt, outer sep=2pt, nodes={inner sep=1pt}, at={(1,1)}, anchor=north east},
    legend cell align=left,
    cycle multi list={{mark=+,mark=o}\nextlist{brown,magenta,teal,blue,lime,green,orange,cyan,gray}},
    mark size=0.8
    ]

    \addplot table...
    \addlegendentry{CTMC: Ermolaev(87)}    
    ...
    \node[anchor=west] at (axis cs: 1.2, 1.48) {F.--T. effective};
    \node[anchor=west] at (axis cs: 1.2, 0.44) {Fermi--Teller limit};

  \end{semilogxaxis}
\end{tikzpicture}
\end{document}

複数の色付きプロットのサンプル

この図ではプロットを区別するのは簡単ではありませんが、印刷するとはるかに簡単になります。また、区別が重要なのは、プロットが分岐する部分のみです。

実線と 2 つの異なるマーカーのみを使用しましたが、これが最も良い結果をもたらすと思います。

関連情報