QCustomPlot Discussion and Comments

QCPAxis - Shfiting xAxis away from the yAxisReturn to overview

Hello,

I am making a bar graph. The xAxis has ticks starting from 0 to 63 (inclusive). The thing is, when I display data on the bar graph, the bars corresponding to 0 and 63 are kinda cut off. I set the range of my axes to [0, 63] (inclusive) and I set the "step" variable to 8.

So my graph is like

|
|
|
|___________________________
0 8 16 24 32 40 48 56

Is there a way for me to shift the xAxis so that it the bars for 0 and 63 are fully visible. So something like

|
|
|
|____________________________________________________
[space here] 0 8 16 24 32 40 48 56 [space here]

which looks like

|
|
|
|____________________________________________________
0 8 16 24 32 40 48 56


Is there any way to do this? Thx


Have you considered just increasing the range, e.g. xAxis->setRange(-7, 63+7)?

Hi DerManu,

Yes, I have tried that. In my case, it would be [-8, 63 + 8=71], however -8 and 71 do not make sense in the context of the graph. It looks fine, but I just don't want to see -8 and 71 on the x axis. I just want 0, 8, 16, ... 56.

consider use QCPAxisTickerText