Adding labels and pins
We can add labels to nodes with a handy syntax that looks like this:
\node[label=direction:text] at (coordinate) {text};
Note that if we don’t specify a coordinate
value, the node will be at the current position in the path. Paths begin at the origin (0,0) by default if no coordinate
value is specified. Knowing this, we will omit the coordinate
value in the following examples, so our nodes will be at (0,0).
Again, it’s good to see it in a picture. Let’s have a ball node with labels, where every label is scaled down by two.
For this, we will first have a brief look at the style syntax, as it’s already convenient here. Until now, we set the key=value
pairs as options for nodes or other elements. To not repeat ourselves, we can set these options for all elements in a drawing by using a single option on the tikzpicture
environment:
\begin{tikzpicture}[every node/.style={key=value}]
The dot is part of the syntax we thoroughly...