QCustomPlot Discussion and Comments

different y axix heights/range span with multiple y axisReturn to overview

Dear all,

I have the need for multiple y axis but they shouldn't have the same height. So I tried to do an ASCII drawing to explain that (the lines are just for simplification straight horizontal lines). In this example there is y axis with the full height and another one that has an offset (in this drawing up to the 25 of the first line - but that should be freely to be choosen) and also ends before reaching the full height of the first y axis.

100 +---------------------------------------------------+
| |
|------------------- Line 1 ----------------------|
50+ 75 + +
| | |
| | |
| 50 +------------------- Line 2 --------------------+
| | |
| | |
0 + 25 +-------------------------------------------------+
| |
+---------------------------------------------------+
0 X


Is there a way to do such things with the y axis?
I thought about a way of setting invisible ticklabels and ticks. But the y axes need to be dragable and zoomable. Therefore I'm not sure if such a workaround will end up in a lot of administration work.

我认为qcustomplot没有你提到的功能。QCPAxixRect中的Y轴(QCPAxis)高度都是一样的。我觉得可以考虑由QCPAxis派生一个新类,重写draw方法,只绘制你需要的区域。