代码拉取完成,页面将自动刷新
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os
path = 'Q:/cross_data/2021-06-25-04-34-43/2021-06-25-04-34-43-PARAMETERS.csv'
path1 = path[:-14] + 'RECORDS1' + '.csv'
path3 = path[:-14] + 'RECORDS3' + '.csv'
path2_0 = path[:-14] +'RECORDS2-'
path_img = path[:-14] + 'FIGURE/'
if not os.path.exists(path_img):
os.mkdir(path_img)
parameters = pd.read_csv(path)
records1 = pd.read_csv(path1)
records3 = pd.read_csv(path3)
def plot_position(index):
path2 = path2_0 + str(index) + '.csv'
records2 = pd.read_csv(path2)
X = records2.Vx.to_numpy()
Y = records2.Vy.to_numpy()
# X = records2.posX.to_numpy()
# Y = records2.posY.to_numpy()
plt.figure()
plt.axis('equal')
plt.plot(X,Y)
path2 = path2_0 + str(index + 1024) + '.csv'
records2 = pd.read_csv(path2)
X = records2.Vx.to_numpy()
Y = records2.Vy.to_numpy()
# X = records2.posX.to_numpy()
# Y = records2.posY.to_numpy()
plt.plot(X, Y)
path2 = path2_0 + str(index+2048) + '.csv'
records2 = pd.read_csv(path2)
X = records2.Vx.to_numpy()
Y = records2.Vy.to_numpy()
# X = records2.posX.to_numpy()
# Y = records2.posY.to_numpy()
plt.plot(X,Y)
path2 = path2_0 + str(index + 1024*3) + '.csv'
records2 = pd.read_csv(path2)
X = records2.Vx.to_numpy()
Y = records2.Vy.to_numpy()
# X = records2.posX.to_numpy()
# Y = records2.posY.to_numpy()
plt.plot(X, Y)
plt.legend([0.6, 0.7, 0.8, 0.9])
plt.savefig(path_img+str(i)+'.jpg')
plt.close('all')
for i in range(977,1024):
i = int(i)
records2 = plot_position(i)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。