QCustomPlot Discussion and Comments

Wrapping of axis tick valuesReturn to overview

I have a navigation program where I need the x-axis to wrap around going from 0-360 to starting at 0 again. I would for instance display a range of 90 degrees and the switch over point would be in the center (358..359..360..1..2..3) of my screen. Is there a way to specify the range as (315; 45) which would force a restart of the x-axis index?

You can achieve this by using two rects without margin in layout, and shared point container.
Say, the initial range is 0-90. In this case the width of the first rect is 90*k (k - сoefficient, pxl for one degree), second rect 0*k;

When the interval is from 0-90 to 270-360, the width of the first rect is 90*k, second rect 0*k. Axis range from 0-90 to 180-270 for axis in first rect, and from 90-180 to 180-360 for second rect.

When the interval is from 0-90 to 270-360, the width of the first rect is 90*k, second rect 0*k. Axis range from 0-90 to 270-360 for axis in first rect, and no matter what in the second rect.

When the interval is from 271-1, the width of the first rect is 89*k, second rect 1*k. Axis range 271-360 for axis in first rect, and 0-1 in second rect.

When the interval is from 272-2, the width of the first rect is 88*k, second rect 2*k. Axis range 272-360 for axis in first rect, and 0-2 in second rect.

When the interval is from 273-3, the width of the first rect is 87*k, second rect 3*k. Axis range 273-360 for axis in first rect, and 0-3 in second rect.

and so on.

When the interval is again 0-90, the width of the first rect is again 90*k, second rect 0*k. Axis range 0-90 for axis in first rect, and no matter what in the second rect.

An illustration of what I want to say:
https://imgur.com/ardnh4C

Periodicity is already supported, see
QCPAxisTickerPi and QCPAxisTickerPi::setPeriodicity

(to get what you want, you could setPiValue to 1 and setPiSymbol to "°", and setPeriodicity to 360)

Thank you @DerManu this is exactly what I was looking for!