Skip to main content
`Ctrl`+`K`

# FillBetweenItem

class pyqtgraph.FillBetweenItem(

  curve1: PlotDataItem | PlotCurveItem,
  curve2: PlotDataItem | PlotCurveItem,
  brush=None,
  pen=None,
  fillRule: FillRule = FillRule.OddEvenFill,

)

  GraphicsItem filling the space between two PlotDataItems.

  __init__(
    curve1: PlotDataItem | PlotCurveItem,
    curve2: PlotDataItem | PlotCurveItem,
    brush=None,
    pen=None,
    fillRule: FillRule = FillRule.OddEvenFill,
  )

    FillBetweenItem fills a region between two curves with a specified `QBrush`.

    Parameters:

      - curve1 (`PlotDataItem` | `PlotCurveItem`) – Line to draw fill from

      - curve2 (`PlotDataItem` | `PlotCurveItem`) – Line to draw fill to

      - brush (`color_like`, optional) – Arguments accepted by `mkBrush()`, used to create the `QBrush` instance used to draw the item by default None

      - pen (`color_like`, optional) – Arguments accepted by `mkColor()`, used to create the `QPen` instance used to draw the item by default `None`

      - fillRule (`QtCore.Qt.FillRule`, optional) – FillRule to be applied to the underlying `QPainterPath` instance, by default `QtCore.Qt.FillRule.OddEvenFill`

    Raises:

      - ValueError – Raised when `None` is passed in as either `curve1` or `curve2`

      - TypeError – Raised when either `curve1` or `curve2` is not either `PlotDataItem` or `PlotCurveItem`

  setBrush(
    *args,
    **kwds,
  )

    Change the fill brush. Accepts the same arguments as `mkBrush()`

  setCurves(
    curve1: PlotDataItem | PlotCurveItem,
    curve2: PlotDataItem | PlotCurveItem,
  )

    Method to set the Curves to draw the FillBetweenItem between

    Parameters:

      - curve1 (`PlotDataItem` | `PlotCurveItem`) – Line to draw fill from

      - curve2 (`PlotDataItem` | `PlotCurveItem`) – Line to draw fill to

    Raises:

      TypeError – Raised when input arguments are not either `PlotDataItem` or `PlotCurveItem`

  setFillRule(
    fillRule: FillRule = FillRule.OddEvenFill,
  )

    Set the underlying `QPainterPath` to the specified `FillRule`

    This can be useful for allowing in the filling of voids.

    Parameters:

      fillRule (`QtCore.Qt.FillRule`) – A member of the `FillRule` enum

  setPen(
    *args,
    **kwds,
  )

    Change the fill pen. Accepts the same arguments as `mkColor()`