QCustomPlot Discussion and Comments

Support for/example of multiple axes per sideReturn to overview


Are multiple axes per side implemented in the latest version (1.0.0-beta)? Do you have an example showing how to do this?


Yes, QCustomPlot 1.0.0-beta can do multiple axes per side. An example will be included in the 1.0.0 release but isn't done yet.

You can add axes to an axis rect with QCPAxisRect::addAxis, please see the documentation for details. Accessing the axes, e.g. at the left axis rect side, then works with QCPAxisRect::axis(QCP::atLeft, index) where index is an integer enumerating the axes of that side starting at 0. The zeroth axis typically is the one you can also access via QCustomPlot::xAxis/yAxis/xAxis2/yAxis2.

The default axis rect of the QCustomPlot can be accessed via yourPlot->axisRect().

Is it possible to zoom/drag only the selected axes when using multiple axes?


DerManu - this works great - thanks.

Ben - Yes, I have my code doing just this. I've connected selectionChanged signals to handlers for each of the three y axes (two on one side and one on the other in my case). The handlers use setRangeZoomAxes and setRangeDragAxes to select the appropriate axis to be dragged/zoomed.

- Jay

Jay - That worked great. Thanks.


I can add axis using addAxis(QCPAxis::atRight). But new axis appeared out of graph. rigth of yAxis2. Can it be left of yAxis2?