How to draw an unit circle using numpy and matplotlib -


i want draw unit circle(cos+sin), using numpy , matplotlib. wrote following:

t = np.linspace(0,np.pi*2,100) circ = np.concatenate((np.cos(t),np.sin(t))) 

and plotted, failed.

ax.plot(t,circ,linewidth=1) valueerror: x , y must have same first dimension 

plot not parametric plot. must give x , y values, not t.

x cos(t) , y sin(t), give arrays plot:

ax.plot(np.cos(t), np.sin(t), linewidth=1) 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -