我试着画两个线条图,下面的区域有阴影。我有三张单子。 其中一个日期。 两个数据集。 每个日期大约有96个值。由于多个y轴(来自两个数据集的值)具有相同的x轴(日期),我认为这会导致图形中出现垂直线来表示这些值
如何让matplotlib绘制平滑线和曲线? 如何删除垂直线而不是显示平均值
list_1= [562.2, 550.8, 531.0, 0.0, .... 524.4, 492.6, 509.4, 502.2, 496.2, 490.2, 4152.48, 149.96, 15.0]
list_2= [562.2, 550.8, 531.0, 0.0, .... 524.4, 492.6, 509.4, 502.2, 496.2, 490.2, 4152.48, 149.96, 15.0]
time = ['11-01', '11-01', '11-01', '11-01', .... '11-30', '11-30' '11-30', '11-30', '11-30', '11-30', '11-30', '11-30', '12-01']
plt.stackplot(time, current_readings, alpha=0.5, color="#ff7f7f", )
plt.stackplot(time, historic_readings, alpha=0.5, color="#7f7fff",)
如果要显示平均值,可以将它们放入data.frame,将groupby放入data.frame(下面称为
avg
)。您可以调用plot作为一种方法,我想在您的例子中,您希望stacked=False,以便它们重叠:或者使用上面的分组数据框,调用matplotlib:
相关问题 更多 >
编程相关推荐