是否可以使用FillBetweenItem填充pyqtgraph中的两个PlotCurveItem?

时间:2016-10-19 19:28:11

标签: python python-2.7 pyqtgraph

我试图在pyqtgraph中使用PlotCurveItem创建的两条曲线之间填充。

            phigh = self.p2.addItem(pg.PlotCurveItem(x, y, pen = 'k'))           
            plow = self.p2.addItem(pg.PlotCurveItem(x, yy, pen = 'k'))           
            pfill = pg.FillBetweenItem(phigh, plow, brush = br)
            self.p2.addItem(pfill)

曲线项目正确绘制,但没有填充。

1 个答案:

答案 0 :(得分:2)

这解决了它。

            phigh = pg.PlotCurveItem(x, y, pen = 'k')           
            plow = pg.PlotCurveItem(x, yy, pen = 'k')                  
            pfill = pg.FillBetweenItem(ph, plow, brush = br)
            self.p2.addItem(ph)
            self.p2.addItem(plow)
            self.p2.addItem(pfill)