QCustomPlot Discussion and Comments

Cannot auto generate new subticker and subticker label after zoom inReturn to overview

Dear all,
Thank you for this amazing widget you develop. I use it quite often and I am always happy with it.

I have a question regarding the logarithmic axis in the plot.
I'm using QCPAxisTickerLog:

customPlot->xAxis->setScaleType(QCPAxis::stLogarithmic);
QSharedPointer<QCPAxisTickerLog> logTicker(new QCPAxisTickerLog);

When I use it, only decades are displayed on my graph (1, 10 , 100, etc...).
Is there a simple way that when you zoom in, you can display more values just like it is done with standard axis?

Many thanks.

Hello i have the same problem ? Anyone have try to solve it

Well the logarithmic axis scaling has a defined base. You can set it with setLogBase

The ticker will only generate integer multiples of that log base as axis intervals/ticks. Because between 1 and 10 there is no further multiple of that base available, it ends there and spreads out the subticks.

What you could do is check the rangeChanged signal of your axis and see if your range.size() is below maybe 20, and then set your log base to 2 or something. (and back to 10 if you go above range.size 20 again)

I'll consider this as a feature request to find a smarter algorithm for cases where the user zooms beyond the configured log base.