von kannstmasehn » Mo 17. Aug 2015, 07:41
Moin,
ich möchte drei Graphen nebeneinander anordnen. Mein bisheriges Minimalbeispiel dafür:
\documentclass[paper=a4,12pt,version=last]{scrartcl}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\usepgfplotslibrary{units}
\usepackage{subfigure}
\begin{document}
\newcommand{\graphscale}{0.5}
\begin{figure}[htpb]
\centering
\subfigure[Lastfall 1]{
\begin{tikzpicture} [scale=\graphscale,baseline=(current axis.south)]
\begin{axis}[
y filter/.code={\ifstr{#1}{}{\pgfmathparse{0.1}}{}},
%xlabel=Auslenkung in y,x unit=m,
ylabel=Auslenkung in z,y unit=m,
legend style={
at={(0.5,-0.25)},
anchor=north,
legend columns=3,
cells={anchor=west},
font=\footnotesize,
%rounded corners=2pt,
},
]
\addplot+[no marks] {x};
\addplot+[no marks] {2*x};
\end{axis}
\end{tikzpicture}
}
\subfigure[Lastfall 2]{
\begin{tikzpicture}[scale=\graphscale,baseline=(current axis.south)]
\begin{axis}[
y filter/.code={\ifstr{#1}{}{\pgfmathparse{0.1}}{}},
xlabel=Auslenkung in y,x unit=m,
legend style={
at={(0.5,-0.25)},
anchor=north,
legend columns=3,
cells={anchor=west},
font=\footnotesize,
rounded corners=2pt,
},
]
\addplot+[no marks] {x};
\addplot+[no marks] {2*x};
\legend{Volumen, Balken}
\end{axis}
\end{tikzpicture}
}
\subfigure[Lastfall 3]{
\begin{tikzpicture}[scale=\graphscale,baseline=(current axis.south)]
\begin{axis}[
y filter/.code={\ifstr{#1}{}{\pgfmathparse{0.1}}{}},
legend style={
at={(0.5,-0.25)},
anchor=north,
legend columns=3,
cells={anchor=west},
font=\footnotesize,
rounded corners=2pt,
},
]
\addplot+[no marks] {x};
\addplot+[no marks] {2*x};
\end{axis}
\end{tikzpicture}
}
\caption{Transienter Verlauf Alte Welle}
\label{pic:kap5:trans_alt}
\end{figure}
\end{document}
Dazu möchte ich die Achsenbeschriftung und die Legende nur je einmal verwenden. Bei meiner Variante mit den subfigures verschiebt sich (b) unschön. Gibt es da Abhilfe, dass dies wieder auf einer Höhe ist bzw. den gleichen Abstand zur x-Achse des Graphen haben? Die Graphen habe ich über baseline neu angeordnet.
Vielen Dank im Voraus und viele Grüße!
Moin,
ich möchte drei Graphen nebeneinander anordnen. Mein bisheriges Minimalbeispiel dafür:
[code]
\documentclass[paper=a4,12pt,version=last]{scrartcl}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\usepgfplotslibrary{units}
\usepackage{subfigure}
\begin{document}
\newcommand{\graphscale}{0.5}
\begin{figure}[htpb]
\centering
\subfigure[Lastfall 1]{
\begin{tikzpicture} [scale=\graphscale,baseline=(current axis.south)]
\begin{axis}[
y filter/.code={\ifstr{#1}{}{\pgfmathparse{0.1}}{}},
%xlabel=Auslenkung in y,x unit=m,
ylabel=Auslenkung in z,y unit=m,
legend style={
at={(0.5,-0.25)},
anchor=north,
legend columns=3,
cells={anchor=west},
font=\footnotesize,
%rounded corners=2pt,
},
]
\addplot+[no marks] {x};
\addplot+[no marks] {2*x};
\end{axis}
\end{tikzpicture}
}
\subfigure[Lastfall 2]{
\begin{tikzpicture}[scale=\graphscale,baseline=(current axis.south)]
\begin{axis}[
y filter/.code={\ifstr{#1}{}{\pgfmathparse{0.1}}{}},
xlabel=Auslenkung in y,x unit=m,
legend style={
at={(0.5,-0.25)},
anchor=north,
legend columns=3,
cells={anchor=west},
font=\footnotesize,
rounded corners=2pt,
},
]
\addplot+[no marks] {x};
\addplot+[no marks] {2*x};
\legend{Volumen, Balken}
\end{axis}
\end{tikzpicture}
}
\subfigure[Lastfall 3]{
\begin{tikzpicture}[scale=\graphscale,baseline=(current axis.south)]
\begin{axis}[
y filter/.code={\ifstr{#1}{}{\pgfmathparse{0.1}}{}},
legend style={
at={(0.5,-0.25)},
anchor=north,
legend columns=3,
cells={anchor=west},
font=\footnotesize,
rounded corners=2pt,
},
]
\addplot+[no marks] {x};
\addplot+[no marks] {2*x};
\end{axis}
\end{tikzpicture}
}
\caption{Transienter Verlauf Alte Welle}
\label{pic:kap5:trans_alt}
\end{figure}
\end{document}
[/code]
Dazu möchte ich die Achsenbeschriftung und die Legende nur je einmal verwenden. Bei meiner Variante mit den subfigures verschiebt sich (b) unschön. Gibt es da Abhilfe, dass dies wieder auf einer Höhe ist bzw. den gleichen Abstand zur x-Achse des Graphen haben? Die Graphen habe ich über baseline neu angeordnet.
Vielen Dank im Voraus und viele Grüße!