Wie stellt man mit pgfplots eine Reihe von Einheitsvektoren dar, deren Winkel aus einer Normalverteilung ausgewählt werden?

Wie stellt man mit pgfplots eine Reihe von Einheitsvektoren dar, deren Winkel aus einer Normalverteilung ausgewählt werden?

Ich möchte NEinheitsvektoren darstellen, deren Winkel aus einer Normalverteilung ausgewählt werden, sagen wir ( mean=90, sd=10), wie im Bild unten.

Ich würde gerne wissen, wie ich dasselbe damit zeichnen könnte pgfplots?

Bildbeschreibung hier eingeben

Antwort1

Herzlich willkommen! So etwas in der Art?

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={gauss(\x)=exp(-pow(\x/10,2));},>=stealth]
 \begin{axis}[hide axis,xmin=-1,xmax=1,ymin=0,ymax=1]
  \pgfmathsetmacro{\myangle}{0}
  \draw[->] (0,0) -- (90:1);
  \pgfplotsinvokeforeach{0,...,10}{
   \pgfmathsetmacro{\myangle}{\myangle+1/(gauss(\myangle))}
   \edef\temp{\noexpand\draw[->] (0,0) -- (90+\myangle:1);
   \noexpand\draw[->] (0,0) -- (90-\myangle:1);}
   \temp 
  }
 \end{axis}
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

Oder mit einer Polarachse.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}[declare function={gauss(\x)=exp(-pow(\x/10,2));},>=stealth]
 \begin{polaraxis}[ymax=1,xmin=0,xmax=180,ytick=\empty]
  \pgfmathsetmacro{\myangle}{0}
  \draw[->] (0,0) -- (90,1);
  \pgfplotsinvokeforeach{0,...,10}{
   \pgfmathsetmacro{\myangle}{\myangle+1/(gauss(\myangle))}
   \edef\temp{\noexpand\draw[->] (0,0) -- (90+\myangle,1);
   \noexpand\draw[->] (0,0) -- (90-\myangle,1);}
   \temp 
  }
 \end{polaraxis}
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen