Advertisement
Tertius

teste

Aug 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. import matplotlib as mpl
  2. from mpl_toolkits.mplot3d import Axes3D
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5.  
  6. mpl.rcParams['legend.fontsize'] = 10
  7.  
  8. FILE_NAME = 'posiรงรฃo-w1.txt'
  9.  
  10. f = open(FILE_NAME, 'r')
  11.  
  12. x = []
  13. y = []
  14. z = []
  15.  
  16. for line in f.readlines():
  17.     coordenadas = line.split('\t')
  18.     x.append(float(coordenadas[0]))
  19.     y.append(float(coordenadas[1]))
  20.     z.append(float(coordenadas[2]))
  21.  
  22. fig = plt.figure()
  23. ax = fig.gca(projection='3d')
  24.  
  25. ax.plot(x, y, z, label='trajetoria')
  26. ax.set(xlabel='x', ylabel='y', zlabel='z')
  27. ax.legend()
  28.  
  29. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement