5

I am not getting the black white cycle list working. All three graphs are solid black lines. I want them to have different dash patterns though!

\documentclass[11pt, a4paper]{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure} [!htbp]
\centering
\begin{tikzpicture}
\begin{axis}[
width=5in,
xlabel={Time},
ylabel={Displacement},
no markers,
yticklabel style={/pgf/number format/fixed},
cycle list name=black white,
]
\addplot+ table [x=time,y=disp_body,col sep=comma]{tables/data_static.csv};
\addplot+ table [x=time,y=disp_spring,col sep=comma]{tables/data_static.csv};
\addplot+ table [x=time,y=disp_tyre,col sep=comma]{tables/data_static.csv};
\addlegendentry{Car body}
\addlegendentry{Spring}
\addlegendentry{Tyre}
\end{axis}
\end{tikzpicture} 
\caption{Determination of static deflections}
\label{fig_static}
\end{figure}
\end{document}

1 Answers1

6

There is nothing wrong with your code (though I wouldn't add standalone plus signs or I would also add []). The reason why they show up static is because the first 5 cycle definitions are with solid lines and with different markers which you turned off. From the manual

enter image description here

If you shift the cycle list you will see that it is working OK.

\documentclass[11pt, a4paper]{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
no markers,
cycle list name=black white,
]
\addplot+[] {rand};\pgfplotsset{cycle list shift=4}
\addplot+[] {rand};
\end{axis}
\end{tikzpicture} 
\end{document}

enter image description here

percusse
  • 157,807