def METHOD_NAME(
    self,
    qp: QtGui.QPainter,
    color: QtGui.QColor,
    data: list[Datapoint],
    delay: list[Datapoint],
):
    pen = QtGui.QPen(color)
    pen.setWidth(self.dim.point)
    line_pen = QtGui.QPen(color)
    line_pen.setWidth(self.dim.line)
    qp.setPen(pen)
    for i, d in enumerate(data):
        x = self.getXPosition(d)
        y = self.getYPositionFromDelay(delay[i])
        if self.isPlotable(x, y):
            qp.drawPoint(int(x), int(y))
        if self.flag.draw_lines and i > 0:
            prevx = self.getXPosition(data[i - 1])
            prevy = self.getYPositionFromDelay(delay[i - 1])
            qp.setPen(line_pen)
            if self.isPlotable(x, y):
                if self.isPlotable(prevx, prevy):
                    qp.drawLine(x, y, prevx, prevy)
                else:
                    new_x, new_y = self.getPlotable(x, y, prevx, prevy)
                    qp.drawLine(x, y, new_x, new_y)
            elif self.isPlotable(prevx, prevy):
                new_x, new_y = self.getPlotable(prevx, prevy, x, y)
                qp.drawLine(prevx, prevy, new_x, new_y)
            qp.setPen(pen)