使用Python绘制
#绘制三维直线图,将飞机飞行的航迹用(经度,纬度和高度)来描述#*************************************************************import matplotlib as mplfrom mpl_toolkits.mplot3d import Axes3Dimport numpy as npimport matplotlib.pyplot as pltimport data1#设置图例的字体大小mpl.rcParams['legend.fontsize'] = 10#绘制一张3D折线图fig = plt.figure()ax = fig.gca(projection='3d')#**************************************************************#原始三维轨迹数据x=data1.xy=data1.yz=data1.z#给坐标轴添加标签ax.set_xlabel('Latitude') #纬度ax.set_ylabel('Longitude') #经度ax.set_zlabel('Height')#绘制地面投影轨迹ax1 = fig.gca(projection='3d')ax1.plot(x,y,label='Ground slide track projection')#绘制空中3D轨迹ax.plot(x, y, z,'g-',label='Air flight 3D trajectory')#显示图例标签ax.legend()#显示绘制的图形plt.show()
轨迹图形: