Note
Go to the end to download the full example code.
Drawing example#
Draw the trefoil knot.
import matplotlib.pyplot as plt
import knotpy as kp
Parsing knotpy notation#
Load the knot from internal representation.
k = kp.PlanarDiagram("3_1")
Drawing the knot#
Draw the know using matplotlib and show it.
kp.draw(k)
plt.show()

Diagram a → X(b3 c0 c3 b0), b → X(a3 c2 c1 a0), c → X(a1 b2 b1 a2)
Diagram a → X(b3 c0 c3 b0), b → X(a3 c2 c1 a0), c → X(a1 b2 b1 a2)
External face: (b3, c1, a1)
Circles packed
Post processing layout
Total running time of the script: (0 minutes 0.167 seconds)