Or use the built-in parametrization in KnotData
:
param = KnotData["Trefoil", "SpaceCurve"];
ParametricPlot3D[
(* reflect/rotate around to get like the picture *)
{1, -1, 1} RotationMatrix[{{0, 1, 0}, {0, 0, 1}}] . param[t],
{t, 0, 2 Pi},
PlotStyle -> {Tube[0.5]}, ColorFunction -> (Hue[0.92 - #3/1.4] &),
PlotPoints -> 100, Axes -> False, Boxed -> False,
PlotRangePadding -> 0.55,
ViewPoint -> {0., -4, -0.5}, ViewVertical -> {-0.05 , 0, 1},
Lighting -> {
DirectionalLight[GrayLevel[0.9], {0, 2, 3}],
DirectionalLight[GrayLevel[0.9], {2, -1, 3}],
AmbientLight[GrayLevel[0.4]]}]
