在jupyter notebook中使用python绘制能带图

Jupyter Notebook中用Python绘制能带图出错

```python
代码块[1]import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif']=['Simhei'] #解决中文显示问题,目前只知道黑体可行
plt.rcParams['axes.unicode_minus']=False #解决负数坐标显示问题
import warnings
warnings.filterwarnings("ignore") #去除警告
%matplotlib inline
[2] import pandas as pd
df=pd.read_csv(r"C:\Users\guohui\Desktop\1BANDMOS2.csv")
df.head(5)
[3] import pandas as pd
from matplotlib import pyplot as plt
plt.figure(figsize=(20,10)) #图片大小
plt.figure(dpi=200) #图片清晰度
for i in range(1,int(120/60)+1): #60个为一次循环,分为若干个图
plt.plot(df['0'][(i-1)60+1:i60],df['-14.228220'][(i-1)60+1:i60])
plt.ylim(-8,8) #y刻度范围
plt.xlim(0.03,1) #x刻度范围
plt.axvline(x=0.425) #添加垂直指定位置的线
plt.axvline(x=0.64)
plt.axhline(y=0,ls="--") #添加水平指定位置的线
plt.xticks([]) #去掉x轴上的刻度
plt.xticks([0.425,0.64,0.03,1],['K','M','G','G']) #给x轴指定位置加名称
plt.ylabel('Energy (eV)') #y轴名称
plt.savefig('Users/guohui/Desktop/cif test.png') #保存路径名称
出错

KeyError Traceback (most recent call last)
~\anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3079 try:
-> 3080 return self._engine.get_loc(casted_key)
3081 except KeyError as err:

pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: '0'

The above exception was the direct cause of the following exception:

KeyError Traceback (most recent call last)
in
4 plt.figure(dpi=200) #图片清晰度
5 for i in range(1,int(120/60)+1): #66个为一次循环,分为若干个图
----> 6 plt.plot(df['0'][(i-1)60+1:i60],df['-14.228220'][(i-1)60+1:i60])
7 plt.ylim(-8,8) #y刻度范围
8 plt.xlim(0.03,1) #x刻度范围

~\anaconda3\lib\site-packages\pandas\core\frame.py in getitem(self, key)
3022 if self.columns.nlevels > 1:
3023 return self._getitem_multilevel(key)
-> 3024 indexer = self.columns.get_loc(key)
3025 if is_integer(indexer):
3026 indexer = [indexer]

~\anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3080 return self._engine.get_loc(casted_key)
3081 except KeyError as err:
-> 3082 raise KeyError(key) from err
3083
3084 if tolerance is not None:

KeyError: '0'

```功能插入代码,请勿粘贴截图

[1]和[2]没有问题,绘制图形的[3]出错
我想要达到的结果