如何使用python pandas或matplotlib获得方波呢

2024-05-20 10:59:49 发布

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

我尝试使用python处理数据以获得SPC或CPK图表。 我想画一条像“UCL”这样的线。但现在,我只能画一条像P-bar一样的线。 我怎样才能容易地得到它

enter image description here

我的代码:

df.plot(x=‘StartDateTime’,y=[‘UCL’,’LCL’,’P-bar’,’P’])
plt.show()

我明白了: enter image description here


Tags: 数据代码dfplotshow图表barplt
1条回答
网友
1楼 · 发布于 2024-05-20 10:59:49

一种方法是使用df.plot()linestyle=参数将绘图的线型设置为“steps”:

df.plot(x='StartDateTime', y=['UCL','LCL','P-bar','P'], linestyle='steps')

相关问题 更多 >