-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathisingplot.py
More file actions
executable file
·32 lines (31 loc) · 824 Bytes
/
isingplot.py
File metadata and controls
executable file
·32 lines (31 loc) · 824 Bytes
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
import matplotlib.pyplot as plt
import numpy as np
import os
result=[]
if os.path.exists('dataIsing'):
fileOb=open('dataIsing')
for line in fileOb:
result.append(list(map(float,line.split(' '))))
length=len(result)
T = np.zeros(length)
M = np.zeros(length)
for i in range(length):
T[i]=result[i][0];
M[i]=(result[i][1]);
plt.plot(T,(M))
plt.axis([0,80,-0.7,1.2])
result=[]
if os.path.exists('dataMagnet'):
plt.figure()
fileOb=open('dataMagnet')
for line in fileOb:
result.append(list(map(float,line.split(' '))))
length=len(result)
H = np.zeros(length)
M = np.zeros(length)
for i in range(length):
H[i]=result[i][0];
M[i]=(result[i][1]);
plt.plot(H,M)
plt.axis([-1.8e-22,1.8e-22,-1.2,1.2])
plt.show()