November 2015
Beginner to intermediate
302 pages
6h 17m
English
In this recipe, we will see how to plot a 3D trefoil knot. A trefoil knot is a closed curve with three crossings. In this recipe, we will draw not just a curve, but a solid 3D curve. This is beyond the plotly capabilities, and we will implement this functionality using a trick.
In this recipe, we will:
plotly.plotly to draw the chart:import numpy as np import plotly.plotly as py from plotly.graph_objs import Scatter3d, Data, Layout from plotly.graph_objs import Figure, Line, Margin, Marker from numpy import linspace,pi,cos,sin phi = linspace(0,2*pi,250) x = sin(phi)+2*sin(2*phi) y ...
Read now
Unlock full access