-
Notifications
You must be signed in to change notification settings - Fork 0
/
xrd_plot.py
49 lines (40 loc) · 1.53 KB
/
xrd_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
# https://zhuanlan.zhihu.com/p/690595828
# data: https://doi.org/10.1038/s41563-023-01702-1 Source Data Fig. 3
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.ticker import MultipleLocator
from spt.plot_params import set_roman_plot_params
color_list = [
"#9900FF",
"#4400FF",
"#007DFF",
"#00FF00",
"#808000",
"#FF6600",
"#FF0000",
"#000000",
]
xlsx_fn = "41563_2023_1702_MOESM5_ESM.xlsx"
df = pd.read_excel(xlsx_fn, sheet_name="Fig.3a", skiprows=2, header=None)
set_roman_plot_params()
fig, ax = plt.subplots()
for i in range(4):
ax.plot(df.iloc[:, 2 * i], df.iloc[:, 2 * i + 1], color=color_list[i])
ax.set_xlim(7.2, 6.6)
ax.set_ylim(50000, 530000)
ax.set_yticks([])
ax.set_xlabel("Chemical shift (ppm)")
ax.xaxis.set_major_locator(MultipleLocator(0.2))
ax.xaxis.set_minor_locator(MultipleLocator(0.1))
fontsize1 = 15
fontsize2 = 12
ax.text(7.18, 140000, "60C, electrolyte", color="#9900FF", fontsize=fontsize1)
ax.text(7.18, 80000, "60C, gas phase", color="#4400FF", fontsize=fontsize1)
ax.text(7.18, 270000, "200C, electrolyte", color="#007DFF", fontsize=fontsize1)
ax.text(7.18, 210000, "200C, gas phase", color="#00FF00", fontsize=fontsize1)
ax.text(7.0, 279000, "$^{14}$NH$_{4}$$^{+}$", fontsize=fontsize2)
ax.text(6.91, 279000, "$^{14}$NH$_{4}$$^{+}$", fontsize=fontsize2)
ax.text(6.82, 279000, "$^{14}$NH$_{4}$$^{+}$", fontsize=fontsize2)
ax.text(6.95, 500000, "$^{15}$NH$_{4}$$^{+}$", fontsize=fontsize2)
ax.text(6.86, 500000, "$^{15}$NH$_{4}$$^{+}$", fontsize=fontsize2)
fig.savefig("xrd.png")