小编dum*_*umm的帖子

如何使用numpy和matplotlib绘制单位圆

我想使用numpy和matplotlib绘制一个单位圆(cos + sin)。我写了以下内容:

t = np.linspace(0,np.pi*2,100)
circ = np.concatenate((np.cos(t),np.sin(t)))
Run Code Online (Sandbox Code Playgroud)

我策划了,但是失败了。

ax.plot(t,circ,linewidth=1)
ValueError: x and y must have same first dimension
Run Code Online (Sandbox Code Playgroud)

geometry numpy matplotlib

1
推荐指数
2
解决办法
5354
查看次数

标签 统计

geometry ×1

matplotlib ×1

numpy ×1