
다양한 색상의 많은(실제로 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}
이 그림에서는 플롯을 구별하기가 쉽지 않지만 인쇄하면 훨씬 쉽습니다. -또한 플롯이 갈라지는 경우에만 구별이 중요합니다.
저는 두 개의 서로 다른 마커에 실선만 사용했는데, 이것이 가장 좋은 결과를 가져온다고 생각합니다.