
Ich zeichne ein parametrisches Diagramm mit pgfplots
und möchte einen bestimmten Punkt auf der Kurve hinzufügen. Ich habe addplot3
+ verwendet coordinates
, um einen bestimmten Marker an bestimmten Koordinaten auf der Kurve hinzuzufügen. Dieser Punkt ist gut positioniert (in Rot). Jetzt möchte ich diesem Punkt einen bestimmten Text in \coordinate
der axis
Umgebung hinzufügen. Ich habe direkte Koordinaten ausprobiert, axis cs
aber nichts funktioniert. Außerdem ist es seltsam, dass in der pgfplots-Dokumentation (Version 1.16, Abschnitt 4.17.1) steht, dass dies axis cs
das Standardkoordinatensystem in der axis
Umgebung ist und weggelassen werden kann. Wenn ich den Punkt jedoch entferne, axis cs
ist er nicht mehr derselbe. Ich bin sicher, ich übersehe etwas :-).
MWE:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
%parameters
\pgfmathsetmacro{\vrotP}{pi/4}
\def\lengthb{4}
\def\lengthh{3}
\pgfmathsetmacro{\timeTot}{4*pi/\vrotP}
\pgfmathsetmacro{\timeMid}{\timeTot/2}
\pgfmathsetmacro{\timeRef}{7}
\begin{tikzpicture}[
declare function={%
theta(\t)=\vrotP*\t;
px(\t)=\lengthb*cos(theta(\t));
py(\t)=\lengthb*sin(theta(\t));
pz(\t)=-\lengthh*theta(\t);
}%
]
\begin{axis}[axis lines=center,
axis on top,
samples y=0,
trig format plots=rad,
xmax=5,
xmin=-5,
ymax=5,
ymin=-5,
zmin=-45,
zmax=0,
]
% \addplot[variable=t,domain=0:10,samples=50]{pz(t)};
\addplot3[blue,line width=2pt,variable=t,domain=0:\timeTot,samples=100]({px(t)},{py(t)},{pz(t)});
% point M
\addplot3+[red,only marks,line width=2pt] coordinates{({px(\timeRef)},{py(\timeRef)},{pz(\timeRef)})};
%
\pgfmathsetmacro{\tmpX}{px(\timeRef)}
\pgfmathsetmacro{\tmpY}{py(\timeRef)}
\pgfmathsetmacro{\tmpZ}{pz(\timeRef)}
\coordinate (orig) at (axis cs:0,0,0);
\coordinate (M) at (axis cs:\tmpX,\tmpY,\tmpZ);
\coordinate (Mp) at (\tmpX,\tmpY,\tmpZ);
\draw(orig)--(M);
\draw(orig)--(Mp);
\node[anchor=south] at (orig) {$O$};
\node[] at (M) {$M$};
\end{axis}
\end{tikzpicture}
\end{document}
Ergebnis: