# Tikz: Define line and marker object in preamble

I have a lot of different plots for specific configurations (c1,c2,...,c10) where I only compare some of the configurations. Lets say plot 1: (c1,c4,c10) and in the next plot (c2,c3,c5). Also I will have the same configuration in dashed or dotted multiple times in one plot (i.e. for different locations or times) like plot 3:(c1,c1 dashed, c3, c3 dashed). Now I want to create objects, storing the color, marker and linestyle information and put them in the preambel, so when I want to change a color all the plots and references change. Thank you for your help in advance!

\documentclass{standalone}

\usepackage{pgf, tikz, pgfplots}

% define the colors, here I am looking for a command, somthing like:
\definestyle{c01}{blue,mark=o}
% ...
% ... and also maybe dashed ones
\definestyle{c10_dashed}{{green!55!black,style=dashed}}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\addplot[style = c01] coordinates {(0,1) (0.5,1.5) (1,1)}; % now use these here somehow
\addplot[style = c10_dashed] coordinates {(0,2) (0.5,2.5) (1,2)};
\end{axis}
\end{tikzpicture}
\end{document}


You can define your own keys with \pgfplotsset. For example,

\documentclass{standalone}

\usepackage{pgf, tikz, pgfplots}
\pgfplotsset{compat=1.16}

\pgfplotsset{c01/.style={blue,mark=o}}
\pgfplotsset{c10_dashed/.style={green!55!black,style=dashed}}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\addplot[c01] coordinates {(0,1) (0.5,1.5) (1,1)}; % now use these here somehow