-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplot.py
54 lines (36 loc) · 1.21 KB
/
plot.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
52
53
54
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 14 13:57:42 2022
@author: Francesco Vascelli
"""
import numpy as np
import matplotlib.pyplot as plt
import sys
import configparser
configu = configparser.ConfigParser()
configu.read(sys.argv[1])
source0 = configu.get('paths','n_back')
source1 = configu.get('paths','n_lost')
source2 = configu.get('paths','n_through')
source3 = configu.get('paths','depth')
destination1 = configu.get('paths','ratio_pic')
def graph_plot():
"""This method plots the ratio of neutrons by destination
as a function of the depth of the reactor wall.
"""
n_back = np.load(source0)
n_lost = np.load(source1)
n_through = np.load(source2)
x_depth = np.load(source3)
f = plt.figure(figsize=(10, 10))
plt.scatter(x_depth,n_back)
plt.scatter(x_depth,n_lost)
plt.scatter(x_depth,n_through)
plt.xlabel("Depth (arbitrary units)", fontsize=25)
plt.ylabel("Probability of final state", fontsize=25)
plt.xticks(fontsize=20)
plt.yticks(np.arange(0.0, 1.0, 0.1), fontsize=20)
plt.ylim(-0.05,1)
plt.legend(['back','lost','through'], loc="upper right", fontsize= 20)
f.savefig(destination1)
graph_plot()