Nice to finally post a question myself after finding solutions to my problems on numerous occasions within these forums. I hope someone can be of help (and that this hasn't been asked already).
The problem is as follows: I'm using pgfplots for the plots within my document. I used the procedure described in section 4.8.7 (Legends outside of an axis) within the pgfplots manual in order to create one legend for several horizontally aligned plots. In general this works fine. My issue is, that the marker style differs between the plot and the legend. I am using the no markers option with \addplot. The legend shows the correct line style but also markers. Is it possible to remove the markers? Did I place the ref{} command to reference the legend in the wrong place? I couldn't find any solution by browsing google or within the manual, hence my question.
The code looks as follows (I can post a minimum working example if necessary):
\begin{figure}[htb]
\centering
\begin{tikzpicture}[baseline]
\begin{axis}
[
legend columns=-1,
legend entries={$Pe_{ax} = 1$;,$Pe_{ax} = 10$;,$Pe_{ax} = 100$;,$Pe_{ax} = 1000$},
legend to name=named3,
width=6cm, height=6cm,
xmin={0},
xmax={2},
ymin={0},
ymax={2},
xtick={0,1,2},
ytick={0,2},
xlabel= {$\Theta [-]$},
ylabel={$E(\Theta) [-]$},
label style={font=\footnotesize},
tick label style={font=\footnotesize},
legend style={draw=none}
]
\addplot+[no markers,smooth, color=black, dashed] coordinates {(1,0) (1,2)};
\addplot+[no markers,smooth, color=black, dotted] table[x=X,y=Y1] {Tabellen/Butt_1999_Bo1.txt};
\addplot+[no markers,smooth, color=black, dashdotdotted] table[x=X,y=Y1] {Tabellen/Butt_1999_Bo10.txt};
\addplot+[no markers,smooth, color=black, dashdotted] table[x=X,y=Y1] {Tabellen/Butt_1999_Bo100.txt};
\addplot+[no markers,smooth, color=black, solid] table[x=X,y=Y1] {Tabellen/Butt_1999_Bo1000.txt};
\end{axis}
\end{tikzpicture}
\hspace{0cm}
\centering
\begin{tikzpicture}[baseline]
\begin{axis}
[
width=6cm, height=6cm,
xmin={0},
xmax={2},
ymin={0},
ymax={1},
xtick={0,1,2},
ytick={0,1},
xlabel= {$\Theta [-]$},
ylabel={$F(\Theta) [-]$},
label style={font=\footnotesize},
tick label style={font=\footnotesize}
]
\addplot+[no markers,smooth, color=black, dashed] coordinates {(1,0) (1,1)};
\addplot+[no markers,smooth, color=black, dotted] table[x=X,y=Y2] {Tabellen/Butt_1999_Bo1.txt};
\addplot+[no markers,smooth, color=black, dashdotdotted] table[x=X,y=Y2] {Tabellen/Butt_1999_Bo10.txt};
\addplot+[no markers,smooth, color=black, dashdotted] table[x=X,y=Y2] {Tabellen/Butt_1999_Bo100.txt};
\addplot+[no markers,smooth, color=black, solid] table[x=X,y=Y2] {Tabellen/Butt_1999_Bo1000.txt};
\end{axis}
\end{tikzpicture}
\ref{named3}
\caption{Text.}
\end{figure}
Hope this helps! Thanks in advance for any ideas, thoughts and the like!
Edit: as requested here is a minimum working example of the problem.
\documentclass[12pt,a4paper]{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[htb]
\centering
\pgfplotsset{domain=-1:1}
\begin{tikzpicture}[baseline]
\begin{axis}
[
legend columns=-1,
legend entries={$x^2$;,$x^3$;,$x^4$;,$x^5$},
legend to name=named,
width=6cm, height=6cm,
xlabel= {$x$},
ylabel={$f(x)$},
legend style={draw=none}
]
\addplot+[no markers,smooth, color=black, dashed]{x^2};
\addplot+[no markers,smooth, color=black, solid] {x^3};
\addplot+[no markers,smooth, color=black, dashdotdotted] {x^4};
\addplot+[no markers,smooth, color=black, dashdotted] {x^5};
\end{axis}
\end{tikzpicture}
\hspace{0cm}
\centering
\begin{tikzpicture}[baseline]
\begin{axis}
[
width=6cm, height=6cm,
xlabel= {$x$},
ylabel={$f'(x)$},
]
\addplot+[no markers,smooth, color=black, dashed]{2*x};
\addplot+[no markers,smooth, color=black, solid] {3*x^2};
\addplot+[no markers,smooth, color=black, dashdotdotted] {4*x^3};
\addplot+[no markers,smooth, color=black, dashdotted] {5*x^4};
\end{axis}
\end{tikzpicture}
\ref{named}
\caption{Minimum working example.}
\end{figure}
\end{document}

no markersas an option to theaxis, this also removes them from the legend. Would that be good enough? I cannot explain why the problem occurs. – Torbjørn T. Aug 24 '13 at 23:29\documentclass{...}and ending with\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Aug 24 '13 at 23:51no markersto the firstaxis, I get the desired output. Doesn't that work for you? Same result if I remove that option from all\addplot+and add it to the secondaxisas well. – Torbjørn T. Aug 25 '13 at 07:28no markersfrom all\addplot+[...]and add it tobegin{axis}[...]I get the following result: [http://imageshack.us/photo/my-images/23/9jxk.jpg/] – Tovja Aug 25 '13 at 07:55pgfplotslying around do you? Add\listfilesto the preamble to get list of packages with versions in the log file. – Torbjørn T. Aug 25 '13 at 08:26