QCustomPlot Discussion and Comments

Drawing Area - Y Axis Range - Closed or open interval ?Return to overview

Hey,

I can't find any information in the documentation concerning the expected visual behaviour of QCP regarding the Y Axis limits.
The question is : is the range a closed or open interval ?
Or to rephrase it, is a point value visible if the value is the same as the range upper/lower value ?

As the behavior is different between QCPGraph and QCPItemLine in such case, i would like to clearly understand the situation before reporting any "bug".

Hi,
Since points that are exactly on the border of a range would require a floating point equality comparison between (at least one) calculated value, it will always be prone to give different results depending on the circumstances, even on the platform you're running the code on. So QCP doesn't make any definitive promises here.
Your best approach is to expand your range by some epsilon (perhaps 0.0001*range.size()) which will be visually imperceptible but give QCP the chance to make a clear larger/smaller decision rather than equality. Have a look here for more on floating point comparison: https://floating-point-gui.de/errors/comparison/

And since it's holiday today: https://xkcd.com/217/