def METHOD_NAME(
    self,
    qp: QtGui.QPainter,
    color: QtGui.QColor,
    data: list[Datapoint],
    fstart: int = 0,
    fstop: int = 0,
):
    if not data:
        return
    fstop = fstop or data[-1].freq
    pen = QtGui.QPen(color)
    pen.setWidth(self.dim.point)
    line_pen = QtGui.QPen(color)
    line_pen.setWidth(self.dim.line)
    qp.setPen(pen)
    prev_x = self.getXPosition(data[0])
    prev_y = int(self.height() / 2 + data[0].im * -1 * self.dim.height / 2)
    for i, d in enumerate(data):
        x = self.getXPosition(d)
        y = int(self.height() / 2 + d.im * -1 * self.dim.height / 2)
        if d.freq > fstart and d.freq < fstop:
            qp.drawPoint(x, y)
            if self.flag.draw_lines and i > 0:
                qp.setPen(line_pen)
                qp.drawLine(x, y, prev_x, prev_y)
                qp.setPen(pen)
        prev_x, prev_y = x, y