There are 3 axes: one in X, two in Y on the right and left. When scaling only one axis (when you hover over the line of the axis itself), only this axis changes the scale, but the second axis needs to be zoomed too
ui->plot->addGraph(ui->plot->xAxis,ui->plot->yAxis); ui->plot->graph(0)->setPen(QPen(Qt::green)); ui->plot->graph(0)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDot,6)); ui->plot->addGraph(ui->plot->xAxis,ui->plot->yAxis2); ui->plot->graph(1)->setPen(QPen(Qt::red)); ui->plot->graph(1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCrossCircle,6)); ui->plot->addGraph(ui->plot->xAxis,ui->plot->yAxis2); ui->plot->graph(2)->setPen(QPen(Qt::yellow)); ui->plot->graph(2)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssPlus,8)); ui->plot->yAxis2->setVisible(true); ui->plot->xAxis->setRange(-0.5,10.5); ui->plot->yAxis->setRange(-0.5,5.5); double tempLowRange=15000./11.; ui->plot->yAxis2->setRange(-tempLowRange,15000); ui->plot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); QList <QCPAxis*> draggableAxes={ui->plot->xAxis,ui->plot->yAxis,ui->plot->yAxis2}; ui->plot->axisRect()->setRangeDragAxes(draggableAxes); ui->plot->axisRect()->setRangeZoomAxes(draggableAxes);
What needs to be added or removed?