早上好,我正在尝试使用Matplotlib在两行之间填充_,我是这样做的:
plt.figure(figsize = (16,8));
plt.plot(estudo_df["Sales"], label='Original Data');
plt.plot(forecast_2018["yhat"], color='red', label='Predictions');
plt.plot(forecast_2018["yhat_lower"], color='green', label='Predictions Lower');
plt.plot(forecast_2018["yhat_upper"], color='Blue', label='Predictions Blue');
plt.fill_between(forecast_2018["yhat_lower"],forecast_2018["yhat_upper"] , color='grey', alpha='0.5')
plt.legend();
plt.title('Forecast Sales Prophet - '+sh);
plt.xlabel('Date');
plt.ylabel('Sales');
但它不起作用
我使用两个具有相同金额和“索引ID”的DS,即日期estudo_df和forecast_2018
有人知道错误在哪里吗
在两个位置更改代码:
我运行您的代码时只注释了一行:
得到:
我的数据框的索引包含日期,但属于字符串类型
相关问题 更多 >
编程相关推荐