我试图在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)
曲线项目正确绘制,但没有填充。
答案 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)