Wie verwende ich Koordinaten in Tikz?

Wie verwende ich Koordinaten in Tikz?

Das Folgende ist mein Code:

\begin{tikzpicture}[node distance=5cm,auto,>=latex', scale = 0.75, transform shape]



\coordinate (a1) [] {};
\node (rect) (a) [draw,minimum width=3cm,minimum height=1cm, below of=a1,node distance=1cm] {Sender};
\node[rectangle] (b) [draw,minimum width=3cm,minimum height=1cm, below of=a,node distance=2cm] {Receiver};
\coordinate (b1) [below=2cm of b] {};
\path[->] (a) edge node {  $f$ } (b);
\path[->] (a1) edge node {  $f$ } (a);
\path[->] (b) edge node {  $f$ } (b1);
\end{tikzpicture}

Ich erhalte die folgende Ausgabe:Bildbeschreibung hier eingeben

Ich möchte einen Pfeil vom Empfänger zu b1.

Kann mir jemand meinen Fehler erklären?

Antwort1

Sie definieren coordinatefalsch. Sie sollten Folgendes tun:

\coordinate [below=2cm of b] (b1) {};

Auf diese Weise funktioniert Ihr Code für mich.

Ihr vollständiger Code sollte also folgendermaßen aussehen:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\begin{document}
\begin{tikzpicture}[node distance=5cm,auto,>=latex', scale = 0.75, transform shape]
\coordinate (a1) {};
\node (rect) (a) [draw,minimum width=3cm,minimum height=1cm, below of=a1,node distance=1cm] {Sender};
\node[rectangle] (b) [draw,minimum width=3cm,minimum height=1cm, below of=a,node distance=2cm] {Receiver};
\coordinate[below=2cm of b] (b1)  {};
\path[->] (a) edge node {  $f$ } (b);
\path[->] (a1) edge node {  $f$ } (a);
\path[->] (b) edge node {  $f$ } (b1);
\end{tikzpicture}
\end{document}

Und das Ergebnis ist dieses:

Bildbeschreibung hier eingeben

verwandte Informationen