'Return the size in pixels that this item may draw beyond the values returned by dataBounds().
This method is called by ViewBox when auto-scaling.'

def pixelPadding(self):

    pad = 0
    if self.curve.isVisible():
        pad = max(pad, self.curve.pixelPadding())
    elif self.scatter.isVisible():
        pad = max(pad, self.scatter.pixelPadding())
    return pad
