21

I am using the tikz package. Is there a typografical/semantic/other reason why

\draw(2,0.6) node[\label=below:$b_1$]{} -- (2,4);

produces a label more below than

\draw(2,0.6) node[below]{$b_1$};

For example, try the following code to notice the difference.

\begin{tikzpicture}
\draw (0,0) -- (1,0);
\draw (2,0.6) node[below]{$b_1$};
\end{tikzpicture}`

\begin{tikzpicture}
\draw (0,0) -- (1,0);
\draw (2,0.6) node[label=below:$b_1$]{};
\end{tikzpicture}

1 Answer 1

27

In the first case the one node is placed below the point with content $b_1$. In the second case a node without content (but still with positive height) is placed at the point and a second node with $b_1$ is placed below it.

Maybe a picture helps:

\begin{tikzpicture}
    \fill (0,0) circle (0.05) node[below,draw]{$b_1$};
    \fill (1,0) circle (0.05) node[label=below:$b_1$,draw]{};
\end{tikzpicture}

example

2
  • Interesting. That means that the "multiple" labels is done by placing extra nodes. Sep 30, 2010 at 1:13
  • 1
    Ah! It was right in front of my face. In the pgfmanual it says "This option is given to a node and it causes another node to be added next to the node where the option is given." Sep 30, 2010 at 1:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .