QCustomPlot Discussion and Comments

A question about logarithmic scaleReturn to overview

Hello,

When my chart, which supports dragging, is displayed using a linear scale, I can bound the ranges to (0, max_value) for both axes. However, when I switch the vertical axis to a logarithmic scale, I can "drag down" because the difference between vertical coordinates becomes infinitesimal and the 0 point seems to be placed infinitely "below", which is undesirable for me: I want to apply the same visual/movement restrictive behavior on the logarithmic scale as well. I have seen the same behavior in a standard QCustomPlot example (plot-example, setupLogarithmicDemo) when its logarithmic scale is enabled (but it does not bound).
Any comment would be greatly appreciated!

I'm not entirely sure I understand. In logarithmic scaling, the zero is always infinitely far away, because log(0)=-inf. This is a mathematical fact and not something QCustomPlot chooses to do. So if you set your lower bound of dragging to stop at 0, the user will always be able to drag further down. From 10^-1 to 10^-2 to 10^-3 etc, and 0 will never be reached. If you wish to hit a stop at a certain point, set it to e.g. 10^-3 if you don't wish your users to drag beyond 0.001

Hi,

Thanks for your reply.
Is there a way to fix the 0 point, when in logarithmic scale, to the same location the non-logarithmic scale 0 resides? I understand why this happens, it's just that this behavior is not consistent and I would like it to be just that.

If you tell me with which factor I have to multiply -inf to get a valid screen coordinate, sure!
;)
(It's mathematically impossible to do what you request.)

I was hoping there was some trick/hack in the software to do it anyway, or make it look like it works as I wish. Thanks for your time and efforts, keep up the good work.