I have 100 values in x axis and 100 ticks. But I want to draw only 10 ticks. How can I do that?
I have 100 values in x axis and 100 ticks. But I want to draw only 10 ticks. How can I do that?
I think this should help you:
ui->customplot->xAxis->setTickStep(10);
With the default behaviour of an axis in QCustomPlot, you don't get 100 ticks. Did you explicitly set them by disabling the auto-ticks mechanism?
I suggest you either use the setAutoTickCount
or disable the auto-tick-step mechanism (via setAutoTickStep
) and then define a constant tick step as Lucasb has already proposed.
OK. Thank you @DerManu, @Lucasb
Hi, I am working with the latest package version 2.1.0 and did not find a way to set the required tick count. As stated by setTickStepStrategy* only two options are available and none of them guarantee the tick step set with setTickStep(n). Moreover, setAutoTickCount/setAutoTickStep is not available (cannot find in v2.1.0 documentation).
*https://www.qcustomplot.com/documentation/classQCPAxisTicker.html
Could somebody give me an advice what I am overlooking?
Many thanks,
Jan
Just to correct myself: setTickStep(n) is not available in v 2.1.0, instead of it I use xAxis->ticker()->setTickCount(n)...