October 2018
Beginner to intermediate
676 pages
18h 30m
English
Here are the steps required to code the required logic:
theta = np.arange(0., 2., 1./180.)*np.pi
fig = plt.figure(figsize=(6, 5), dpi=100)
ax = fig.add_subplot(111, projection='polar')
initial_n = 4ax.plot(theta, 5*np.cos(initial_n*theta))
ax_s = plt.axes([0.15, 0.05, 0.25, 0.05])slider_n = Slider(ax_s, '#of leaves', 3, 10, valinit=initial_n, valstep=1.0)
def onchanged(s_value): ax.clear() ax.plot(theta, 5*np.cos(int(s_value)*theta))
Read now
Unlock full access