customPlotHandle->yAxis->setRange(0, 300);
customPlotHandle->xAxis->setRange(400, 800);
QCPItemPixmap *MyImage = new QCPItemPixmap(ui->spectraPlot);
MyImage->setPixmap(QPixmap(":/images/images/colorSpectrum.png"));
//MyImage->topLeft->setType(QCPItemPosition::ptPlotCoords);
//MyImage->bottomRight->setType(QCPItemPosition::ptPlotCoords);
MyImage->topLeft->setCoords(ui->spectraPlot->xAxis->range().lower, ui->spectraPlot->yAxis->range().upper);
MyImage->bottomRight->setCoords(ui->spectraPlot->xAxis->range().upper, ui->spectraPlot->yAxis->range().lower);
MyImage->setScaled(true, Qt::IgnoreAspectRatio);
ui->spectraPlot->setCurrentLayer("background");
MyImage->setLayer("background");
This is my current code, i need to set background image for xaxis range(400:800) . But in this it also needs yaxis range. for now i have just set it to maximum.
But problem it takes longer time process if axis range changes.
Can you point me to an example where 2 graphs are added to same plot ,
graph(0) for background Image and
graph(1) for data.