1 Star 0 Fork 0

Dashvvood/pit_car

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
draw.py 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
Dashvvood 提交于 2021-06-25 12:05 . :ambulance:
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)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Dashvvood/pit_car.git
git@gitee.com:Dashvvood/pit_car.git
Dashvvood
pit_car
pit_car
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385