-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotResults.py
executable file
·51 lines (41 loc) · 1.46 KB
/
plotResults.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/home/mathias/Envs/myProject/bin/python
#!/usr/bin/python3
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
# X = np.genfromtxt("Output/X.txt", unpack=True)
coil = np.genfromtxt("Output/theCoil.txt")
X = np.genfromtxt("Output/X.txt")
Z = np.genfromtxt("Output/Z.txt")
Bx = np.genfromtxt("Output/Bx.txt")
By = np.genfromtxt("Output/By.txt")
Bz = np.genfromtxt("Output/Bz.txt")
print(coil[:,0])
fig = plt.figure()
ax = fig.gca(projection = '3d')
ax.plot(coil[:,0], coil[:,1], coil[:,2])
fig.savefig('Output/theCoil.png', bbox_inches = "tight")
# plt.clf()
# plt.contourf(X, Z, Bx, cmap=cm.coolwarm)
# plt.savefig('Output/Bx.png', bbox_inches="tight")
# plt.clf()
# plt.contourf(X, Z, By, cmap=cm.coolwarm)
# plt.savefig('Output/By.png', bbox_inches="tight")
# plt.clf()
# plt.contourf(X, Z, Bz, cmap=cm.coolwarm)
# plt.savefig('Output/Bz.png', bbox_inches="tight")
fig = plt.figure()
ax = fig.gca(projection = '3d')
ax.plot_surface(X, Z, Bx, cmap = cm.coolwarm, antialiased = False)
fig.savefig('Output/Bx.png', bbox_inches = "tight")
fig = plt.figure()
ax = fig.gca(projection = '3d')
ax.plot_surface(X, Z, By, cmap = cm.coolwarm, antialiased = False)
fig.savefig('Output/By.png', bbox_inches = "tight")
fig = plt.figure()
ax = fig.gca(projection = '3d')
ax.plot_surface(X, Z, Bz, cmap = cm.coolwarm, antialiased = False)
fig.savefig('Output/Bz.png', bbox_inches = "tight")
# Axes3D.plot_surface(X,Z,Bz)
# plt.show()