美文网首页
Matplotlib: Parametric curve

Matplotlib: Parametric curve

作者: LET149 | 来源:发表于2023-08-27 09:56 被阅读0次
    1. 模块:matplotlib.pyplot
    1. 方法:scatter()

1. 基础绘图

import matplotlib.pyplot as plt


ax = plt.figure().add_subplot(projection='3d')

# Prepare arrays x, y, z
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)

ax.plot(x, y, z, label='parametric curve')
ax.legend()

plt.show()
image.png

2. 参数

相关文章

网友评论

      本文标题:Matplotlib: Parametric curve

      本文链接:https://www.haomeiwen.com/subject/explpdtx.html