def plot_trajectory_3D(traj):
"""
Plot airplane trajectory in 3D.
Parameters
----------
traj: object (AirplaneTrajectory instance).
AirplaneTrajectory instance.
Returns
-------
-.
"""
fig = plt.figure()
fp = Axes3D(fig)
fp.plot(traj.flight_x, traj.flight_y, traj.flight_z, label='Airplane trajectory')
fp.legend()
fp.set_xlabel('x position')
fp.set_ylabel('y position')
fp.set_zlabel('z position')
figv = plt.figure()
fv = figv.gca(projection='3d')
fv.plot(traj.flight_vx, traj.flight_vy, traj.flight_vz, label='Airplane velocity')
fv.set_xscale('linear')
fv.set_yscale('linear')
fv.set_zscale('linear')
fv.legend()
fv.set_xlabel('x velocity')
fv.set_ylabel('y velocity')
fv.set_zlabel('z velocity')
plt.show()
评论列表
文章目录