Matplotlib中的打印列表

2024-04-19 14:03:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我必须列出这类(系列和预告片):

enter image description here

我试着把他们安排在一起

az = series.plot(figsize=(12,8), label='o')
ax = pred_upd.plot(style='r--', label='Dynamic Prediction');
ax.legend();
az.legend();
plt.plot()
plt.show()

我收到错误:

^{pr2}$

我做错了什么?在


Tags: plotstyleshowpltdynamicaxlabelaz
1条回答
网友
1楼 · 发布于 2024-04-19 14:03:58

如果您正在使用^{},我认为您使用它不正确。我不能真正推断出type是什么变量series和{}是什么,但我假设它们属于{}类型(从您的示例中)。在

要使用matplotlib:

import matplotlib.pyplot as plt
plt.plot(series)
plt.hold(True)
plt.plot(pred_upd)
plt.show()

你可以把一些参数放在那里-但那应该是格式。在

相关问题 更多 >