I'm using pgfplots to plot multiple lines, but after a certain number of lines, they seem to revert to dashed lines regardless of line style.
Is there a way to fix this? The code to generate the figure is attached:
\documentclass[10pt]{article}
\usepackage{pgfplots}
\definecolor{markercolor}{RGB}{124.9, 255, 160.65}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
\addplot+[color=magenta,mark=*,semithick, mark options={solid,fill=markercolor}]
coordinates{(1,1)(2,2)(3,3)(4,4)(5,5)};
\addplot+[color=magenta,mark=square*,semithick, mark options={solid,fill=markercolor}]
coordinates{(1,2)(2,4)(3,6)(4,8)(5,10)};
\addplot+[color=black,mark=*,semithick, mark options={solid,fill=markercolor}]
coordinates{(1,3)(2,6)(3,9)(4,12)(5,15)};
\addplot+[color=black,mark=square*,semithick, mark options={solid,fill=markercolor}]
coordinates{(1,4)(2,8)(3,12)(4,16)(5,20)};
\addplot+[color=red,mark=*,semithick, mark options={solid,fill=markercolor}]
coordinates{(1,5)(2,10)(3,15)(4,20)(5,25)};
\addplot+[color=red,mark=square*,semithick, mark options={solid,fill=markercolor}]
coordinates{(1,6)(2,12)(3,18)(4,24)(5,30)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
Best Answer
mark options
only affects the marks - not the style of the lines.\addplot+
adds options to those which would be used by\addplot
, which would default to cycling through line styles, colours etc. So only options you explicitly override don't take effect. If you don't want the options to be appended, use\addplot[<options>]
instead. For example:gives
Or, for the same result with less hassle: