如何使用 matplot lib 在 x 轴上移动图

问题描述

我有 5 个列表 [er1,er2,er3,er4 和 er5](可以转换为 pandas 数据帧),长度分别为 10,9,8,7,6

当我使用这段代码绘制它们时:

er1=[]
for i in range(0,10):    
    er1.append(mse(X[0:2,i],Y[0:2,i+1]))
    

plt.plot(er1,color='blue')

...  (here the same piece as above for the rest of lists

plt.show()

结果如下

enter image description here

但是,我想将 er2 在 x 轴上向右移动一个位置,将 er3 移动两个位置,依此类推。但是,当我尝试 er2.shift (在熊猫上)时,没有任何变化。

我错过了什么吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)