0%

SCI作图模版

本文内容为python matplotlib包总结的SCI论文模版,内容不全面,不断更新中……

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
import numpy as np
import matplotlib.pyplot as plt
from pylab import * #控制刻度线

#格式设置区域
plt.figure(figsize=(8.3,6))#图片大小设置
label_font = {'family':'Arial','weight':'normal','size':22}#设置标签和图例字体
legend_font = {'family':'Arial','weight':'normal','size':12}
plt.xlabel('Vacancy at n layer',label_font)
plt.ylabel('Vacancy formation energy (ev)',label_font)
plt.yticks(fontproperties = 'Arial', size = 18)
plt.xticks(fontproperties = 'Arial', size = 18)
plt.xticks(np.arange(1, 5.1, 1))#横坐标范围及间隔
matplotlib.rcParams['patch.linewidth'] = 1.5#图例边框线宽度
plt.rcParams['xtick.direction'] = 'in'#将x周的刻度线方向设置向内
plt.rcParams['ytick.direction'] = 'in'#将y轴的刻度方向设置向内
plt.tick_params(which='major',width=2,length=6)#设置刻度线宽度
bwith = 2#加粗图四周边框
ax=plt.gca()
ax.spines['bottom'].set_linewidth(bwith)
ax.spines['top'].set_linewidth(bwith)
ax.spines['left'].set_linewidth(bwith)
ax.spines['right'].set_linewidth(bwith)
ms = 12 #标记符号大小
ld = 1.5 #线宽度
mew = 1 #标记边框线宽度

##############Plot input region#################
name = 'fig2_vfe'
style = 'pdf'#设置图片格式
x = [1,2,3]
x1 = [1,2,3,4,5]
y1 = [0.672943,1.024707,0.891641,0.898325,0.868871]
y2 = [11.38964,12.06575,11.69664,12.57189,12.57274]
y3 = [1.13963,1.45938,1.72544,1.7293,1.76786]
y4 = [9.33593,9.3378,9.33955]
y5 = [4.17834,4.11902,4.11519,4.11813,4.11791]
y6 = [-0.09993,-0.14572,-0.1498,-0.14282,-0.14325]
y7 = [0.36766,0.22478,0.36611,1.94956,1.96229]

plt.plot(x1,y1,c='#32CD32',ls = '',marker='o',mew=mew, mec='black',lw=ld,ms=ms,label='$\mathregular{Mg_v}$ in pure Mg')
plt.plot(x1,y2,c='b',ls = '',marker='o',mew=mew, mec='black',lw=ld,ms=ms,label='$\mathregular{Mg_v}$ in $\mathregular{MgF_2}$')
plt.plot(x1,y3,c='b',ls = '',marker='^',mew=mew, mec='black',lw=ld,ms=ms,label='$\mathregular{F_v}$ in $\mathregular{MgF_2}$')
plt.plot(x,y4,c='r',ls = '',marker='o',mew=mew, mec='black',lw=ld,ms=ms,label='$\mathregular{Mg_v}$ in $\mathregular{Mg(OH)_2}$')
plt.plot(x1,y6,c='r',ls = '',marker='v',mew=mew, mec='black',lw=ld,ms=ms,label='$\mathregular{O_v}$ in $\mathregular{Mg(OH)_2}$')
plt.plot(x1,y7,c='r',ls = '',marker='s',mew=mew, mec='black',lw=ld,ms=ms,label='$\mathregular{OH_v}$ in $\mathregular{Mg(OH)_2}$')
#############Plot input region end###############

plt.legend(loc='upper right',bbox_to_anchor=(0.99,0.8), prop=legend_font,edgecolor='black')
# plt.grid()
plt.tight_layout()
plt.savefig(name+'.pdf',dpi = 300)
plt.show()