我正在写论文,并且有数据显示我分子的结构变化。这些结构性变化正在颠覆d轨道的布置。
为了显示一个渐进的反转,我想绘制一个图形,以完美的结构(所有键= 2.1)作为我的x轴中心,并向左绘制,如果我逐渐从改变两个键,会发生什么情况? 2.1至2.2。轴的右边也是正的,从中心2.1开始,一直到2.2(但仅显示更改为一个键会发生的情况)。
到目前为止,我能做到的最好的是:
plt.figure(figsize=(9, 8))
dxy = sns.stripplot(x="Bond", y="Energy(cm-1)", data=dfbd, jitter=False, dodge=False, size=44, marker="_", linewidth=2, hue="Orbital")
plt.ylabel("Energy (Eh)")
如果您想尝试一下或对如何实现这一点有任何见解,我将非常感谢。
以下是CSV格式的数据:
,Type,Bond,Orbital,Energy(cm-1)
0,D4h,2.1,dyz,0.0
1,D4h,2.1,dyz,1.2
2,D4h,2.1,dxz,6.0
3,D4h,2.1,dx2-y2,6473.1
4,D4h,2.1,dz2,6491.1
5,D4h,2.12,dxz,0.0
6,D4h,2.12,dyz,62.9
7,D4h,2.12,dxy,84.3
8,D4h,2.12,dz2,6233.7
9,D4h,2.12,dx2-y2,6560.8
10,D4h,2.14,dxz,0.0
11,D4h,2.14,dyz,125.9
12,D4h,2.14,dxy,171.2
13,D4h,2.14,dz2,5992.8
14,D4h,2.14,dx2-y2,6650.5
15,D4h,2.16,dxz,0.0
16,D4h,2.16,dyz,184.7
17,D4h,2.16,dxy,254.8
18,D4h,2.16,dz2,5761.5
19,D4h,2.16,dx2-y2,6736.9
20,D4h,2.18,dxz,0.0
21,D4h,2.18,dyz,239.4
22,D4h,2.18,dxy,335.4
23,D4h,2.18,dz2,5539.6
24,D4h,2.18,dx2-y2,6820.6
25,D4h,2.2,dxz,0.0
26,D4h,2.2,dyz,290.4
27,D4h,2.2,dxy,413.0
28,D4h,2.2,dz2,5327.0
29,D4h,2.2,dx2-y2,6901.5
30,D4h*,2.1,dyz,0.0
31,D4h*,2.1,dyz,1.2
32,D4h*,2.1,dxz,6.0
33,D4h*,2.1,dx2-y2,6473.1
34,D4h*,2.1,dz2,6491.1
35,D4h*,2.12,dxz,0.0
36,D4h*,2.12,dyz,29.0
37,D4h*,2.12,dxy,39.1
38,D4h*,2.12,dz2,6359.1
39,D4h*,2.12,dx2-y2,6514.3
40,D4h*,2.14,dxz,0.0
41,D4h*,2.14,dyz,60.6
42,D4h*,2.14,dxy,82.5
43,D4h*,2.14,dz2,6239.0
44,D4h*,2.14,dx2-y2,6559.1
45,D4h*,2.16,dxz,0.0
46,D4h*,2.16,dyz,90.0
47,D4h*,2.16,dxy,124.3
48,D4h*,2.16,dz2,6123.8
49,D4h*,2.16,dx2-y2,6602.2
50,D4h*,2.18,dxz,0.0
51,D4h*,2.18,dyz,117.3
52,D4h*,2.18,dxy,164.5
53,D4h*,2.18,dz2,6013.3
54,D4h*,2.18,dx2-y2,6643.9
55,D4h*,2.2,dxz,0.0
56,D4h*,2.2,dyz,142.9
57,D4h*,2.2,dxy,203.2
58,D4h*,2.2,dz2,5907.6
59,D4h*,2.2,dx2-y2,6684.2
答案 0 :(得分:1)
在@ImportanceOfBeingErnest的评论之后,我倾向于采用“假轴”路线,因为它避免了围绕多个轴,多个标签,图例等的混乱。
df.loc[:,'fake_Bond'] = df.Bond
df.loc[df.Type=='D4h', 'fake_Bond'] = 2.0 + abs(df.loc[df.Type=='D4h', 'Bond'] - 2.2)
plt.figure(figsize=(9, 8))
dxy = sns.stripplot(x="fake_Bond", y="Energy(cm-1)", data=df, jitter=False, dodge=False, size=44, marker="_", linewidth=2, hue="Orbital")
plt.ylabel("Energy (Eh)")
dxy.set_xticklabels(np.concatenate([np.linspace(2.2,2.1,6),np.linspace(2.12,2.2,5)]))
dxy.set_xlabel("D4h $\longleftarrow$ Bond $\longrightarrow$ D4h*")