val time
5.6 2021-11-18 03:00:00
2.034 2021-11-18 05:00:00
1.171 2021-11-18 07:00:00
3.023 2021-11-18 09:00:00
4.202 2021-11-18 16:00:00
1.202 2021-11-18 17:00:00
5.202 2021-11-18 18:00:00
7.202 2021-11-18 19:00:00
2.202 2021-11-18 20:00:00
12.202 2021-11-18 21:00:00
1.202 2021-11-18 21:00:00
上面是我的資料框,我想繪制它(x=time,y=value),并將值繪制為紅色(val>5)。
plt.plot(ab['time'], ab['value'], '-gD', markevery=marks, label='line with select markers')
其中標記[7.202,12.202]是我手動創建的串列。但這不起作用。
error -: markevery is iterable but not a valid numpy fancy index

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/362630.html
標籤:Python 熊猫 matplotlib 时间序列 散点图
