How do I converted a digitalized curve into a list of piecewise Bezier curves for export into SVG PATH.
I have a sampled signal which I'd like to present as a polar graph in SVG with Bezier curves.
How do I curve fit this with Bezier curves and export to SVG (real data is a bit less predictable, sin is just an example that looks similar).
from matplotlib import pyplot as plt
import numpy as np
x=np.linspace(0,np.pi*2*5,500)
y=np.abs(np.sin(x)) + np.random.random(x.shape)*0.2
plt.plot(x,y,".")
# polar
Th = x / 5
r = y + 2
xp = np.cos(Th) * r
yp = np.sin(Th) * r
plt.figure(figsize=(10,10))
plt.plot(xp,yp,".")