# Change the forms of curves to distinguish between them

If we assume 2 curves in the same figure. So to distinguish between them, we set a different colors for them. However, can we change the form not the color ? In other words, if we assume that we have 5 curves, and to distinguish between them, we set a specific form for each of them. Any help?

By the way, you can read the code below (taken from this link).

\documentclass{article}
\usepackage{tikz,pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[%
axis x line=bottom,
axis y line=left,
xlabel=$X$,
ylabel=$Y$,
legend pos= south east]
\addplot[mark=none,blue,thick] coordinates {(0.1, 0.003) (0.5, 0.005) (2, 0.4) (5, 1)};
\addplot[mark=none,red,thick] coordinates {(0.1, 0.2) (0.5, 0.5) (2, 0.1) (5, 1.4)};
\legend{$Y_1$,$Y_2$};
\end{axis}
\end{tikzpicture}
\end{document}


-
You mean for example one solid line and one dashed line? –  Torbjørn T. Nov 11 '13 at 21:34
Exactly! one solid line, one dashed line, one with other form.. i need at least 4 or 5 forms :) Thank you very much for your response! –  Christina Nov 11 '13 at 21:36

There are several line styles available in pgfplots. The default is a solid line, other options include dashed, dotted, dashdotted, and dense and loose versions of the same, e.g. densely dashed and loosely dashed. See section 4.7.2 Line Styles of the pgfplots manual.

You can also specify your own pattern with dash pattern, for example dash pattern=on 10pt off 2pt on 5pt off 6pt.

Add these to the options of the \addplot, just like the colours. For example:

\documentclass{article}
\usepackage{tikz,pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[%
axis x line=bottom,
axis y line=left,
xlabel=$X$,
ylabel=$Y$,
legend pos=north west]
\legend{$Y_1$,$Y_2$,$Y_3$,$Y_4$,$Y_5$};

@Liszt I added a custom one, but as I mention there are densely dashed/densely dotted etc. as well. –  Torbjørn T. Nov 11 '13 at 21:49