QCustomPlot Discussion and Comments

Multiple Axis on the same side with different sizeReturn to overview


I want to create a custom graph with 3 graphs
Is it possible to create 3 axis (on left side for example) :
- each axis with a different size ( rannge from 0 to 10; range from 0 to 20 ; range from -120 to -20)
- each axis above the other one.


When you say "each axis above the other one", do you mean vertically separated? In that case, you should have a look at the advanced axes demo, which shows how to create multiple axis rects in a plot. And for your case, make the plot have three horizontally stacked axis rects (so the plot layout then has 1 column and 3 rows). Then you have the effect you need.

If you want them side by side, just use QCPAxisRect::addAxis(QCPAxis::atLeft) on the main axis rect to add more axes to the left side.

Yes, vertically separated. I create 3 axis rects and it's OK.

Is is possible to define the size of each axis rect ?
I have some numerical data (range from 0 to 1) and analogical data (with different range). The axis of numerical is about 1cm on the screen, the other can have different size.

Is it possible to change the rawspacing for each axis rect in a layout ?

Thank you for your help

It works with setMaximumSize and setMinimumSize for the size of each axis rect.

I change the size of each axis using

Is it possible to change the rawspacing for each axis rect in a layout ?

Do you mean