I am trying to produce a sequence/time diagram showing the synchronisation process of a master and slave in the Precision Time Protocol using TikZ. Being very new to TikZ I don't know much more than the primitives for drawing lines and placing nodes, which seems almost enough for such a simple diagram.
The problem I am having is that I cannot figure out how to make lines and arrows converge precisely in a single point on an axis. Here is what it looks like now (not the actual diagram but close):
Up close:
As you can see there is quite a gap between the three lines converging on the t-axis. How do I remove such gaps and have the lines converge precisely in one point on the t-axis?
Or is there a better way to draw such diagrams?
Here is a MWE:
\documentclass[]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [->,thick] (0,8) node (Master) [above] {Master} -- (0,0) node [below right] {t};
\draw [->,thick] (5,8) node (Slave) [above] {Slave} -- (5,0) node [below right] {t};
\node (t1) at (0,7) [left] {$t_1$};
\node (t2) at (5,6) [right] {$t_2$};
\node (t3) at (0,3) [left] {$t_3$};
\node (t4) at (5,1) [right] {$t_4$};
\draw[->] (t1) -- (t2);
\draw[->] (t2) -- (t3);
\draw[->] (t3) -- (t4);
\draw[very thin,dashed] (t2) -- ++(-6,0);
\draw[very thin,dashed] (t3) -- ++(6,0);
\draw[very thin,dashed] (t1) -- ++(6,0);
\draw[very thin,dashed] (t4) -- ++(-6,0);
\end{tikzpicture}
\end{document}
Thanks in advance!
(node)
syntax (as opposed to(node.anchor)
), TikZ stops the line at the border of the node (which contains the text plus a margin of sizeinner sep
). – Caramdir Jun 4 '11 at 16:47