12

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}
19

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

  • Interesting. That means that the "multiple" labels is done by placing extra nodes. – Anna Taurogenireva Sep 30 '10 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." – Anna Taurogenireva Sep 30 '10 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.