forked from ICCP/ising
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeplots.R
More file actions
executable file
·39 lines (27 loc) · 1.36 KB
/
makeplots.R
File metadata and controls
executable file
·39 lines (27 loc) · 1.36 KB
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
wolff <- read.table("temperature_sweep.dat",header=T)
attach(wolff) #Attaches wolff to R search path; wolff$Value becomes Value
sus.max = which.max(Susceptibility)
cv.max = which.max(Cv)
print(paste("Susceptibility max occurs at:",Temperature[sus.max]) ,sep = " ")
print(paste("Cv max occurs at:",Temperature[cv.max]) ,sep = " ")
par(mfrow = c(2,2), oma = c(0,0,2,0), mar = c(5,5,2,2) - .3)
#opens graphics device with 2x2 matrix for plots, 2 line outer margin
plot(Temperature,Magnetization,type="p",
xlab="Temperature",ylab="<Magnetization>")
abline(v = Temperature[sus.max],col = "red",lty = 3)
abline(v = Temperature[cv.max],col = "green",lty = 3)
plot(Temperature,Susceptibility,type="p",
xlab="Temperature",ylab="Susceptibility")
abline(v = Temperature[sus.max],col = "red",lty = 3)
abline(v = Temperature[cv.max],col = "green",lty = 3)
plot(Temperature,Energy,type="p",
xlab="Temperature",ylab="<Energy>")
abline(v = Temperature[sus.max],col = "red",lty = 3)
abline(v = Temperature[cv.max],col = "green",lty = 3)
plot(Temperature,Cv,type="p",
xlab="Temperature",ylab="<Heat Capacity>")
abline(v = Temperature[sus.max],col = "red",lty = 3)
abline(v = Temperature[cv.max],col = "green",lty = 3)
mtext("Monte Carlo simulation of Ising model", line = .5, outer = T)
detach(wolff)
dev.copy2eps(file="system_plots.eps")