
Ich verwende den folgenden Code, um in Tikz einen Pfeil zu zeichnen \pgfplotsset{compat = 1.3}
:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.3}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=10,ymin=0,ymax=10,ylabel={Some values},ylabel shift = -10pt]
\draw[->,thick] (3,3) -- (4,4);
\end{axis}
\end{tikzpicture}
\end{document}
aber ich bekomme den Pfeil an einer falschen Stelle. Ich muss mindestens die Version 1.3 verwenden, da ich den Befehl ylabel shift
zum Verschieben des Etiketts benötige pgfplots
(wie indiese Antwort).
Ist jemand auf das gleiche Problem gestoßen?
Antwort1
Das Problem kann durch Hinzufügen axis cs:
von \draw[->,thick] (650,66) -- (530,69)
: gelöst werden.
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.3}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=10,ymin=0,ymax=10,ylabel={Some values},ylabel shift = -10pt]
\draw[->,thick] (axis cs:3,3) -- (axis cs:4,4);
\end{axis}
\end{tikzpicture}
\end{document}
Wie vorgeschlagen indieser Kommentar.
pgfplots
Eine andere mögliche Lösung besteht darin, eine höhere Version von ( ) zu verwenden \pgfplotsset{compat = 1.16}
:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=10,ymin=0,ymax=10,ylabel={Some values},ylabel shift = -10pt]
\draw[->,thick] (3,3) -- (4,4);
\end{axis}
\end{tikzpicture}
\end{document}
Wie vorgeschlagen indieser Kommentar.