Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use FillBetweenItem to fill between two PlotCurveItem's in pyqtgraph?

I'm attempting to fill between two curves that were created using PlotCurveItem in pyqtgraph.

            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)

The curve items are plotting properly however there is no fill.

like image 889
Mike C. Avatar asked Nov 15 '25 22:11

Mike C.


1 Answers

This fixed it.

            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)
like image 158
Mike C. Avatar answered Nov 18 '25 00:11

Mike C.