Hi,
I have created a QCPColorPlot and I use a SIGNAL-SLOT connection to read the coordinates of any point of the cursor. Although the zero point of my plot is the lower-left corner, I realized that the y coordinate that returns the following function is zero on the upper site of the plot. The x coordinate works properly.
void MainWindow::mouseMoveEvent2_5(QMouseEvent* event) { double x = ui->customPlot2_5->xAxis->pixelToCoord(event->pos().x()); double y = ui->customPlot2_5->yAxis->pixelToCoord(event->pos().y()); double z = colorMap->data()->data(x, y); qDebug() << "x: " x << "y: " << y << "z: " << z; }
How can I change the zero point of the coordinates from the upper-left corner, to the lower-left corner?