aaa
# -*- coding: utf-8 -*- """ Created on Mon Dec 12 23:37:26 2016
@author: matterd """
import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np from mpl_toolkits.mplot3d import Axes3D
fid = open("/home/matterd/Documents/Python/chainer/dataset/CMU_dataset/cmudatasetpart3/01_01.txt", "r")
lines = fid.readlines()
joint_point = []
for line in lines: temp = np.array(line.split(",")).astype(np.float32) temp = np.reshape(temp,[-1,3]) joint_point.append(temp)
joint_point = np.array(joint_point) print(joint_point.shape)
X, Y, Z = joint_point[:,:,0], joint_point[:,:,2], joint_point[:,:,1] fig = plt.figure() ax = Axes3D(fig) ims = []
for i in range(len(joint_point)): #im = ax.scatter3D(X[i,:],Y[i,:],Z[i,:]) im = plt.plot(X[i,:],Y[i,:], Z[i,:], 'o') ims.append(im) ani = animation.ArtistAnimation(fig, ims, interval=50)
plt.show()