Coordinates in TikZ
Master the different coordinate systems and positioning techniques in TikZ.
Cartesian Coordinates
The default coordinate system uses (x,y) pairs. The default unit is centimeters:
Available Units
| Unit | Name | Size |
|---|---|---|
cm | Centimeters | 1 cm (default) |
mm | Millimeters | 0.1 cm |
in | Inches | 2.54 cm |
pt | Points | 1/72.27 in |
em | Em (font-relative) | Width of 'M' |
ex | Ex (font-relative) | Height of 'x' |
Polar Coordinates
Specify points using angle and distance: (angle:radius)
Relative Coordinates
Use ++ and + for relative positioning:
++ updates the reference point after each move.+ keeps the original reference point.
Named Coordinates
Save coordinates for reuse with names:
Coordinate Calculations
Use the calc library for mathematical coordinate operations:
Intersection Points
Find where lines intersect using the intersections library:
Node Anchors
Nodes have predefined anchor points for precise connections:
Transformations
Apply transformations to coordinates:
Canvas Transformations
Change the default coordinate system:
Next Steps
Continue learning TikZ:
- Nodes and Labels - Position text and shapes
- Flowcharts - Use coordinates in diagrams
- Graphs - Network diagrams with coordinates
Coordinates in TikZ
Master the different coordinate systems and positioning techniques in TikZ.
Cartesian Coordinates
The default coordinate system uses (x,y) pairs. The default unit is centimeters:
Available Units
| Unit | Name | Size |
|---|---|---|
cm | Centimeters | 1 cm (default) |
mm | Millimeters | 0.1 cm |
in | Inches | 2.54 cm |
pt | Points | 1/72.27 in |
em | Em (font-relative) | Width of 'M' |
ex | Ex (font-relative) | Height of 'x' |
Polar Coordinates
Specify points using angle and distance: (angle:radius)
Relative Coordinates
Use ++ and + for relative positioning:
++ updates the reference point after each move.+ keeps the original reference point.
Named Coordinates
Save coordinates for reuse with names:
Coordinate Calculations
Use the calc library for mathematical coordinate operations:
Intersection Points
Find where lines intersect using the intersections library:
Node Anchors
Nodes have predefined anchor points for precise connections:
Transformations
Apply transformations to coordinates:
Canvas Transformations
Change the default coordinate system:
Next Steps
Continue learning TikZ:
- Nodes and Labels - Position text and shapes
- Flowcharts - Use coordinates in diagrams
- Graphs - Network diagrams with coordinates
