draw spiral in matplotlib

Solutions on MaxInterview for draw spiral in matplotlib by the best coders in the world

showing results for - "draw spiral in matplotlib"
Hannes
18 Jun 2017
1import numpy as np 
2import matplotlib.pyplot as plt 
3import matplotlib.cm as cm 
4
5n = 256
6angle = np.linspace(0,12*2*np.pi, n)
7radius = np.linspace(.5,1.,n)
8
9x = radius * np.cos(angle)
10y = radius * np.sin(angle)
11
12plt.scatter(x,y,c = angle, cmap = cm.hsv)
13plt.show()
14
15// Matplotlib CB