Hello,
I have following code from the examples

type="Label1";
       { // add the text label at the top:
       QCPItemText *textLabel = new QCPItemText(m_ui->logplot);

        textLabel->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter);
        textLabel->position->setType(QCPItemPosition::ptAxisRectRatio);
        textLabel->position->setCoords(0.5, 0); // place position at center/top of axis rect


         textLabel->setText(type);
      textLabel->setFont(QFont(font().family(), 16)); // make font a bit larger
        textLabel->setPen(QPen(Qt::black)); // show black border around text
        }

first thing: no match for call to "(QFont)()" when compiling, no matter I can live with normal font.
second thing: whenever I change the Label (Type) and replot ,the old label stays in background.I tried textLabel->setText("") but still the same.How to delete old label?