python 飞机作业路线3D展示
增雨飞机作业路线是excel形式存储的文件,里面有经度、纬度、作业高度的信息,画一个作业路线的3d图
代码如下:
#!usr/bin/env python # -*- coding:utf-8 -*- """ @author: Suyue @file: shiyan.py @time: 2024/06/26 @desc: """ import pandas as pd import matplotlib.pyplot as plt input_file = r'/202308040900.xlsx' # 防止中文乱码 plt.rcParams['font.sans-serif'] = ['Microsoft YaHei'] df = pd.read_excel(input_file) x = df['经度'] y = df['纬度'] z = df['高度'] fig = plt.figure() ax = fig.add_subplot(projection='3d') ax.plot(x,y,z,label='operation routes') ax.legend() plt.show()
结果: