Using shapes and anchors
While rectangle and circle node shapes are available by default, others require loading the shapes
package, as we did in the previous section.
We will explore many of them now.
A rectangle shape
A rectangle
node has anchors in all compass directions, as we can see here, with a node named (n)
:
Figure 3.6 – Rectangle shape with anchors
In addition to these, we have a few more anchors available:
center
: The middle of the node, which is the default anchor.base
: At the baseline of the node text and centered horizontally. It is helpful for the vertical alignment of text nodes. Thebase west
andbase east
anchors are at the baseline height and on the west and east sides, respectively.text
: At the left of the text baseline.mid
: At half-height of the lowerx
and centered horizontally. It is also helpful for vertically aligning nodes with text that may have different heights and depths. Also, here,...