
Ich dachte, es wäre eine einfache Aufgabe...aber ich bin kurz davor aufzugeben, weil ich nicht in der Lage bin, eineinfachPfeil zwischen zwei Punkten. Mein MWE funktioniert nur, wenn ich \pgfplotsset{compat=newest} entferneUnd \draw. Die PDF-Ausgabe istunberechenbar, tatsächlich ist der Pfeil an der falschen Stelle, wenn etwas erscheint. Keines der ähnlichen Beispiele in Stack... funktioniert. Ich vermute, dass ich etwas Grundlegendes übersehe. Vielen Dank für Ihre Hilfe.
Mein MWE
\documentclass[border=4pt]{standalone}
%
\usepackage{pgfplots}
%
\pgfplotsset{compat=newest} % added without success
%
\begin{document}
%
\begin{tikzpicture}[scale=1.0]
%
\begin{axis}
%
\addplot[domain=0.5:3, red, thin] {(x^2-3)/2};
%
\end{axis}
%
\coordinate (orig) (0,0)
%
\coordinate (R) at (2,1/2)
%
\draw [->,thick,blue] (orig) -- (R)
%
\end{tikzpicture}
%
\end{document}
Antwort1
Willkommen! Es gibt zwei Dinge. Ihnen fehlen drei Semikolons und ein at
. Aber ich schätze, die Frage ist, warum die Koordinaten nicht dort sind, wo Sie sie haben möchten. Das liegt daran, dass Sie sie im Ambient tikzpicture
und nicht innerhalb des definieren axis
. Wenn Sie dies beheben, erhalten Sie
\documentclass[border=4pt]{standalone}
%
\usepackage{pgfplots}
%
\pgfplotsset{compat=newest} % added without success
%
\begin{document}
%
\begin{tikzpicture}[scale=1.0]
%
\begin{axis}
%
\addplot[domain=0.5:3, red, thin] {(x^2-3)/2};
%
\coordinate (orig) at (0,0);
\coordinate (orig') at (0.5,-3/2);
\coordinate (R) at (2,1/2);
\end{axis}
%
\draw [->,thick,blue] (orig') -- (R);
%
\end{tikzpicture}
%
\end{document}