October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following are the steps to implement the required logic:
fig = plt.figure(figsize=(5, 5))ax = fig.add_axes([0, 0, 1, 1], frameon=False)
n_bubbles = 50bubbles = np.zeros(n_bubbles, dtype=[('position', float, 2), ('size', float, 1), ('growth', float, 1), ('color', float, 4)])
bubbles['position'] = np.random.uniform(0, 1, (n_bubbles, 2))
scat = ax.scatter(bubbles['position'][:, 0], bubbles['position'][:, 1], s=bubbles['size'], lw=0.5, facecolors=bubbles['color'])
def animate(frame_number): # Get the index of the ...
Read now
Unlock full access