import pandas as pd
import matplotlib.pyplot as plt

# 创建一个dataframe
file = r"C:\Users\cicv\Desktop\PJI_robot_evaluate_V1.1.0\task_0416\2024-04-16-10-20-45_obstacledetection_30\EgoState_pji.csv"

df = pd.read_csv(file)

# 绘制散点图

plt.scatter(df['posX'], df['posY'], c=df['simTime'], s=0.1)
plt.axis('equal')

# 添加坐标轴标签和标题
plt.xlabel('posX')
plt.ylabel('posY')
plt.title('Trajectory')

# 显示图形
plt.savefig("./track.png")
plt.close()
