Danke, das hilft etwas weiter.
pgf kann also C.
Allerdings: Mit nur 100 Samples sieht man an den Unstetigkeitsstellen eine deutliche "Unschönheit". D.h., die Anzahl Stützstellen muss erhöht werden. Das erhöht dramatisch die Übersetzungszeit.
Ich muss etwas ausholen - dann wird mein
Minimalbeispiel allerdings nicht mehr "minimal".
Letztendlich möchte ich Augendiagramme zeichnen. In Matlab (oder Octave) kann man ja 1000 einzelne Wellenzüge übereinander legen und erhält nach gefühlt dutzend Millisekunden ein "nett anzuschauendes" Ergebnis.
Nun möchte ich es aber Standalone mit
pgf machen und keine Matlab-Grafik als PDF einbinden (es sollen auch Leute bearbeiten können, die Matlab weder installiert haben noch damit umgehen können).
VORSICHT: Mein untenstehendes Beispiel zeigt deutlich die "Unschönheiten", braucht aber dutzende Sekunden zum Übersetzen!
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\def\aDamp{-8 }
\def\aNoise{0.35*rand }
\def\aStyle{thick}
\begin{tikzpicture}
\begin{axis}[
samples=100,
declare function={
mypartial(\x)={(\x > 4) ? ( 1-e^(\aDamp *(\x-4)) ) :
( (\x > 3) ? ( e^(\aDamp *(\x-3)) ) :
( (\x > 2) ? ( 1-e^(\aDamp *(\x-2)) ) :
( (\x > 1) ? ( e^(\aDamp *(\x-1)) ) :
( 1-e^(\aDamp *\x) ) ) ) )
};
}
]
\addplot[\aStyle,domain=0:3.15] { mypartial(x)};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
samples=30,
declare function={
mypartial(\x)={(\x > 4) ? ( 1-e^(\aDamp *(\x-4)) ) :
( (\x > 3) ? ( e^(\aDamp *(\x-3)) ) :
( (\x > 2) ? ( 1-e^(\aDamp *(\x-2)) ) :
( (\x > 1) ? ( e^(\aDamp *(\x-1)) ) :
( 1-e^(\aDamp *\x) ) ) ) )
+\aNoise
};
}
]
\foreach \aCount in {1,2,...,20} {
\addplot[\aStyle,domain=0:3.15] { mypartial(x)};
\addplot[\aStyle,domain=0:3.15] { mypartial(x+1)};
}
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
samples=150,
declare function={
mypartial(\x)={(\x > 4) ? ( 1-e^(\aDamp *(\x-4)) ) :
( (\x > 3) ? ( e^(\aDamp *(\x-3)) ) :
( (\x > 2) ? ( 1-e^(\aDamp *(\x-2)) ) :
( (\x > 1) ? ( e^(\aDamp *(\x-1)) ) :
( 1-e^(\aDamp *\x) ) ) ) )
+\aNoise
};
}
]
\foreach \aCount in {1,2,...,20} {
\addplot[\aStyle,domain=0:3.15] { mypartial(x)};
\addplot[\aStyle,domain=0:3.15] { mypartial(x+1)};
}
\end{axis}
\end{tikzpicture}
\end{document}
Gruß vom Rolli
P.S.: Seit heute muss man sich für Overleaf anmelden? ?? ???