效果
三维绘制曲线
'''
p1 x1,y1,z1
p2 x2,y2,z2
p3 x3,y3,z3
plot([x1,x2,x3],[y1,y2,y3],[z1,z2,z3)]
'''
分别设置x,y,z对应的数组,即可改变对象在空间中的位置位置
line.set_xdata(x[:i + 1])
line.set_ydata(y[:i + 1])
line.set_3d_properties(z[:i + 1])
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import animation
fig = plt.figure(1)
ax = fig.add_subplot(1, 1, 1, projection='3d') # 指定三维空间做图
t = np.linspace(0, 4, 200) # 在0到4之间,均匀产生200点的数组
theta = t * 2 * np.pi # 角度
# 生成曲线数组
z = t
x = np.sin(theta)
y = np.cos(theta)
# 运动的点
point, = ax.plot([x[0]],