import numpy as np import random import math import numpy as np import matplotlib.pyplot as plt cnt = np.zeros(600) for t in range(0,600): cnt[t] = t*0.2 vx = np.loadtxt("D:/wsf1x.csv",delimiter=",", dtype=float) vy = np.loadtxt("D:/wsf1y.csv",delimiter=",", dtype=float) vz = np.loadtxt("D:/wsf1z.csv",delimiter=",", dtype=float) plt.rcParams['font.sans-serif'] = ['Microsoft YaHei'] plt.xlabel('时间 单位:秒') plt.ylabel('z坐标 单位:米') for i in range(0,35): xt = np.zeros(600) for j in range(0,600): if(vz[i,j]) == 0 and vz[i,j-1]!=0: vz[i,j] = vz[i,j-1] xt[j] = vz[i,j] plt.plot(cnt,xt) plt.show()