QCustomPlot Discussion and Comments

Synchronizing displayed windowsReturn to overview

In a spectroscopic application, I have a spectrum window and a residual window, in a vertical splitter. Dragging the splitter bar solves that the horizontal axis range changes synchronously in the two windows. However, the vertical axis labels and axis title may take different place in the two windows, and as a consequence, the two xAxis positions may slightly differ. Is there any way to tell to the other window, where the real data display rectangle is located?

If I understand correctly your question, then it should be possible with QCPMarginGroup. Here is a small snippet taken from http://www.qcustomplot.com/index.php/demos/advancedaxesdemo

// synchronize the left margins of the top and bottom axis rects:
QCPMarginGroup *marginGroup = new QCPMarginGroup(customPlot);
subRectLeft->setMarginGroup(QCP::msLeft, marginGroup);
wideAxisRect->setMarginGroup(QCP::msLeft, marginGroup)

This will ensure that the margins on both QCPAxisRect are the same size.

Thanks, it may be the thing I need