I have to create a presentation with lots of diagrams. I do this with the beamer class and pgfplots. I'm tired of copying the axis definition in every single diagram and I'm looking for a way to put it in the preamble of the presentation file. Tried to create a newcommand \axisdefintion but this didn't work.
Is there a way to have the axis definition in the preamble (except for the title)?
This is what such a diagram would look like:
\begin{tikzpicture}
\begin{axis}[
title={Some Title here},
every axis label/.append style={font=\sffamily\footnotesize},
width=\textwidth,
axis line style=thin,%Achsenstärke
filter discard warning=false,
axis line style={gray!30},
axis y line = center,
axis x line = center,
y tick label style={font={\sansmath\sffamily\fontsize{4}{4}\selectfont}, anchor=east},
x tick label style={font={\sansmath\sffamily\fontsize{4}{4}\selectfont}, anchor=north},
x label style={at={(axis description cs:1.0,-0.03)},anchor=north, font={\tiny}},
y label style={at={(axis description cs:-0.08,.5)},rotate=90,anchor=south, font={\tiny}},
xlabel=Zeit in ms,
ylabel=Sensorwerte,
every y tick/.style={gray!30},
ytick={-550,-500,...,1350},
xtick={0,1000,...,12840},
no markers,
every axis plot/.append style={thin},
every axis/.append style={font=\sffamily},
axis on top=false,
font={\sffamily},
xmin=0, xmax=12900,
ymin=-550, ymax=1360,
legend style={fill=none, draw=none, at={(1.1,0.05)},anchor=east,font={\fontsize{4}{2}\selectfont}, /tikz/column 2/.style={column sep=5pt},},
legend columns=2,
legend cell align={left},
every node near coord/.append style={font=\sansmath\sffamily\fontsize{4}{2}\selectfont, color={DarkRed}},
]
%%Plots
%%add some plots here
\end{axis}
\end{tikzpicture}