Other threads seem to indicate it is possible to use margin group across multiple QCustomPlot objects. The advanced axes demo seems to indicate that QCPMarginGroup aligns axes even when it's aligning elements in different grid layouts. But for some reason, it just doesn't seem to work that way for me. I'm using the 2.0.0 beta and Qt 5.5. My toy experiment is at https://github.com/shavera/QCPMarginGroup-Experiment .
Essentially, I make two widgets that each have a QCustomPlot, one of which has a color scale as a second element in its grid layout. I want to align the left and right edges of the two plots. So I make a QCPMarginGroup in the main window, and use it to set the layouts of the two plots created. I've tried a few variations on this, but it just doesn't seem to work the way I'm hoping.