QCustomPlot Discussion and Comments

how to get a axis's tick step and subtick step?Return to overview

hi, how to get an axis's tick step and sub-tick step? it seams that there's no API for this, the range only shows the lower and upper, but I don't know an axis's tick and sub-tick counts.

thanks!

binghoo dang

That's easy:
QCustomPlot *customPlot = new QCustomPlot (this);
customPlot->xAxis->setRange (....);
QVector<double> tickValue = = customPlot->xAxis->tickVector();
int tickNumber = tickValue.size();

For sub-tick, add public function subtickVector() in class QCPAxis,that is,
QVector<double> subtickVector() const { return mSubTickVector; }