Graduation-Project/script/roi2.py

29 lines
776 B
Python

import numpy as np
from matplotlib import pyplot as plt
or1 = [10, 11, 12, 13, 14]
or2 = [12.14, 13.35, 14.57, 15.79, 17]
energy = [600, 650, 700, 750, 800, 850, 900, 950]
markers = ["^", "+", "s", "D", "."]
data = np.loadtxt("test/eff2.txt")
data = data.reshape(3, 5)
roi = np.loadtxt("test/roi2.txt")
roi = roi.reshape(3, 5)
roi = 1 - roi / data
plt.figure(dpi=400)
for k in range(5):
plt.scatter([7, 8.5, 10], roi[:, k], label=r"$R_o/R_i$ = {:.2f}".format(or1[k] / 7), marker=markers[k])
plt.xlabel(r"$R_i$ [cm]", fontsize=15)
plt.xticks([7, 8.5, 10])
plt.ylabel(r"Energy Leakage Rate $\epsilon$", fontsize=15)
plt.legend(loc="lower right")
plt.tight_layout()
plt.subplots_adjust()
# plt.show()
plt.savefig("/home/fox/Documents/Thesis/figures/chap3/Fig7(b).png")