QCustomPlot Discussion and Comments

Zoom in and out in a ColormapReturn to overview

Dear all,
I used a color map to display a altitude map, see https://pasteboard.co/JkPp29q.png
I used the colormap example I found in the documentation.
Now I would like to zoom in. What could be a convenient strategy?

Ideally I would not create a new color map every time but instead visualize a part of it

I looked into the scroll bar demo, would this apply to my case?

You should use the interaction QCustomPlot provides

auto customPlot = new QCustomPlot();

Have a look at the documentation, especially at the QCP::Interaction section.

Indeed it works like that, I already found and I did the following:

  ui->plot->setInteraction(QCP::iRangeDrag, true);
  ui->plot->setInteraction(QCP::iRangeZoom, true);

this brought other issues:
I added custom ticks to xAxis2 and yAxis2 and those get overwritten by the default ticks when zooming
The content of the colormap changes by zooming, but the colorscale doesn't get updated
I tried to mention it here: https://www.qcustomplot.com/index.php/support/forum/2184

I see now that the zoom and pan on the colorscale already works, just it's not in sync with the colormap. So basically zooming in schows a part of the colormap, but the colorcsale does not get automatically redrawn.

But more important, I have no idea about how to preserve the custom ticks while zooming in/out, as the axis shows the default one ( the pixel index)