-
Notifications
You must be signed in to change notification settings - Fork 2
/
display.py
29 lines (22 loc) · 919 Bytes
/
display.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
################################################################################
# LIEN UTILE : #
# #
# http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html #
# #
################################################################################
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
plt.rcParams['legend.fontsize'] = 13
data = np.loadtxt('2penning.res')
x = data[:,1]
y = data[:,2]
z = data[:,3]
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.set_xlabel('X (m)')
ax.set_ylabel('Y (m)')
ax.set_zlabel('Z (m)')
ax.plot(x, y, z, label='Trajectoire de la particule')
ax.legend()
plt.show()