Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scipy import interpolate
- yao = np.asarray(yo[0::10])
- xao = np.asarray(xo[0::10])
- #plt.plot(xao, yao)
- print(len(xao))
- okayo = np.where(np.abs(np.diff(xao)) + np.abs(np.diff(yao)) > 0)
- xpo = np.r_[xao[okayo], xao[-1]]
- print(len(xpo))
- ypo = np.r_[yao[okayo], yao[-1]]
- tcko, uo = interpolate.splprep([xpo, ypo], s=3, k=1, per=False)
- xo, yo = interpolate.splev(np.linspace(0, 1, 100), tcko)
- fig = plt.figure()
- ax = plt.subplot(111)
- ax.plot(xao, yao, '.', markersize=2)
- ax.plot(xo, yo, alpha=0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement