von esdd » Fr 21. Sep 2012, 12:58
Hallo,
hier sind ein paar Vorschläge, die vielleicht weiterhelfen:
3. (blau): du gibst für das zweite Diagramm yshift=9cm an und verschiebst es damit nach oben. Soll es unter dem ersten stehen muss es yshift=-9cm heißen.
1. (rot): lass die scope weg und schreib yshift=-9cm zu den Optionen der axis Umgebung und/oder verwende für die Positionierung der x-Achseneinheit das "axis description cs"
2. (violett): mit dem"axis description cs" kannst du auch die Legenden positionieren
5. (gelb): verwende major tick length=<länge> statt grid=major für den x tick label style
\documentclass{scrreprt}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}
\pgfmathdeclarefunction{gauss}{2}{\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}}
\usepackage{siunitx}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
height=10cm,
xmin=4700,xmax=5300,
ymin=0,ymax=0.008,
samples=50,smooth,
xtick={4800,4900,...,5300},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=4
},
every axis x label/.style={
at={(1,0)},anchor=north west},
xlabel=\si{\micro\second},
extra x ticks={5000},
x tick label style={/pgf/number format/1000 sep=},
extra x tick style={
major tick length=4.8cm,
dashed,very thick,
tick label style={yshift=5cm}
},
axis x line*=bottom,axis y line*=left,
enlargelimits=upper,
legend style={at={(1.1,0.9)},anchor=north east}]
\addplot[domain=4700:5300, mark=none, dotted, very thick] {gauss(4999.917,52.785)};
\addplot[domain=4700:5300, mark=none, dashed, very thick] {gauss(4999.983,98.974)};
\addplot[domain=4700:5300, mark=none, very thick] {gauss(4999.983, 104.614)};
\legend{$\sigma=\num{31.223}$ $\mu=\num{4999.893}$, $\sigma=\num{82.197}$ $\mu=\num{4999.645}$, $\sigma=\num{36.276}$ $\mu=\num{4999.932}$}
\end{axis}
\begin{axis}[yshift=-9cm,
height=10cm,
xmin=3300,xmax=6700,
ymin=0,ymax=0.0025,
samples=50,smooth,
xtick={3500,4000,...,6500},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=5
},
every axis x label/.style={
at={(1,0)},anchor=north west},
xlabel=\si{\micro\second},
extra x ticks={5000},
x tick label style={/pgf/number format/1000 sep=},
extra x tick style={
major tick length=4.8cm,
dashed,very thick,
tick label style={yshift=5cm}
},
axis x line*=bottom,axis y line*=left,
enlargelimits=upper,
legend style={at={(1.1,0.9)},anchor=north east}]
\addplot[domain=3300:6700, mark=none, dotted, very thick] {gauss(5000.312,159.984)};
\addplot[domain=3300:6700, mark=none, dashed, very thick] {gauss(5000.884,272.425)};
\addplot[domain=3300:6700, mark=none, very thick] {gauss(5003.129,629.461)};
\legend{$\sigma=\num{31.223}$ $\mu=\num{4999.893}$, $\sigma=\num{82.197}$ $\mu=\num{4999.645}$, $\sigma=\num{36.276}$ $\mu=\num{4999.932}$}
\end{axis}
\end{tikzpicture}
\caption{bla}
\label{fig:bla}
\end{figure}
\end{document}
Gruß
Elke
Hallo,
hier sind ein paar Vorschläge, die vielleicht weiterhelfen:
3. (blau): du gibst für das zweite Diagramm yshift=9cm an und verschiebst es damit nach oben. Soll es unter dem ersten stehen muss es yshift=-9cm heißen.
1. (rot): lass die scope weg und schreib yshift=-9cm zu den Optionen der axis Umgebung und/oder verwende für die Positionierung der x-Achseneinheit das "axis description cs"
2. (violett): mit dem"axis description cs" kannst du auch die Legenden positionieren
5. (gelb): verwende major tick length=<länge> statt grid=major für den x tick label style
[code]\documentclass{scrreprt}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}
\pgfmathdeclarefunction{gauss}{2}{\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}}
\usepackage{siunitx}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
height=10cm,
xmin=4700,xmax=5300,
ymin=0,ymax=0.008,
samples=50,smooth,
xtick={4800,4900,...,5300},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=4
},
every axis x label/.style={
at={(1,0)},anchor=north west},
xlabel=\si{\micro\second},
extra x ticks={5000},
x tick label style={/pgf/number format/1000 sep=},
extra x tick style={
major tick length=4.8cm,
dashed,very thick,
tick label style={yshift=5cm}
},
axis x line*=bottom,axis y line*=left,
enlargelimits=upper,
legend style={at={(1.1,0.9)},anchor=north east}]
\addplot[domain=4700:5300, mark=none, dotted, very thick] {gauss(4999.917,52.785)};
\addplot[domain=4700:5300, mark=none, dashed, very thick] {gauss(4999.983,98.974)};
\addplot[domain=4700:5300, mark=none, very thick] {gauss(4999.983, 104.614)};
\legend{$\sigma=\num{31.223}$ $\mu=\num{4999.893}$, $\sigma=\num{82.197}$ $\mu=\num{4999.645}$, $\sigma=\num{36.276}$ $\mu=\num{4999.932}$}
\end{axis}
\begin{axis}[yshift=-9cm,
height=10cm,
xmin=3300,xmax=6700,
ymin=0,ymax=0.0025,
samples=50,smooth,
xtick={3500,4000,...,6500},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=5
},
every axis x label/.style={
at={(1,0)},anchor=north west},
xlabel=\si{\micro\second},
extra x ticks={5000},
x tick label style={/pgf/number format/1000 sep=},
extra x tick style={
major tick length=4.8cm,
dashed,very thick,
tick label style={yshift=5cm}
},
axis x line*=bottom,axis y line*=left,
enlargelimits=upper,
legend style={at={(1.1,0.9)},anchor=north east}]
\addplot[domain=3300:6700, mark=none, dotted, very thick] {gauss(5000.312,159.984)};
\addplot[domain=3300:6700, mark=none, dashed, very thick] {gauss(5000.884,272.425)};
\addplot[domain=3300:6700, mark=none, very thick] {gauss(5003.129,629.461)};
\legend{$\sigma=\num{31.223}$ $\mu=\num{4999.893}$, $\sigma=\num{82.197}$ $\mu=\num{4999.645}$, $\sigma=\num{36.276}$ $\mu=\num{4999.932}$}
\end{axis}
\end{tikzpicture}
\caption{bla}
\label{fig:bla}
\end{figure}
\end{document}[/code]
Gruß
Elke