QCustomPlot Discussion and Comments

How do I adjust the scale of the positive and negative y axis separatelyReturn to overview

How do I adjust the scale of the positive and negative y axis separately, like this:
y
6|
5|
4|
3|
2|
1|
______________________>
1e-6| x
1e-5|
1e-4|
1e-3|
1e-2|
1e-1|

To achieve this effect you create two axis rect below each other with the layout system. Then remove all the vertical gap between them (try experimenting with setRowSpacing of the plotLayout, and setMargins/setAutoMargins of the axis rects). Finally, you connect the ranges of the bottom axis of the upper axis rect with the bottom axis of the lower axis rect, and set the bottom axis of the lower axis rect to be invisible.

Now you have two separately scaleable y axes. To have the same graph data shown, you create two graphs, one per axis rect, and have them share a mutual QSharedPointer<QCPGraphDataContainer> via their graph->setData method.