提交 3295c744 编写于 作者: 肥鼠路易's avatar 肥鼠路易

上传新文件

上级 b3ec0243
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 18:02:16 2021
@author:
"""
# import necessary module
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
# load data from file
# you can replace this using with open
data1 = np.loadtxt("/home/user/github/PlaneSLAM-master/res/groundtruth.txt")
# plot3(gtTraj(:, 2), gtTraj(:, 3), gtTraj(:, 4), '.-g');
first_2000 = data1[:, 2]
second_2000 = data1[:, 3]
third_2000 = data1[:, 4]
# print to check data
print (first_2000)
print (second_2000)
print (third_2000)
# new a figure and set it into 3d
fig = plt.figure()
ax = fig.gca(projection='3d')
# set figure information
ax.set_title("3D_Curve")
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("z")
# draw the figure, the color is r = read
figure = ax.plot(first_2000, second_2000, third_2000, c='r')
plt.show()
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册