1 Attachment(s)
Re: QwtSplineCurveFitter and auto scale
Hello,
I use the QwtSplineCurveFitter for my data and it seems that the auto scale does only take the plot points into consideration, not the temporary points from the fit curve:
Attachment 13764
Is there a way to auto scale the y axis in a way that the whole fit curve is visible?
Oh, btw we use Qwt 6.1.4.
Re: QwtSplineCurveFitter and auto scale
The curve fitter is part of the rendering that happens after autoscaling, when points have already been translated to paint device coordinates. So you probably have to process the spline interpolation manually and pass the result as curve points - what of course does not work well with logarithmic scales.
Please note that Qwt 6.2 offers various sorts of spline interpolation/approximation algos. As the cubic spline algo ( the only one available with Qwt 6.1 ) is expensive and prone for overshooting I would use a different one: see: https://qwt.sourceforge.io/class_qwt_spline.html You can have a look at the splineeditor example to compare the effect of the available algos.
Manual interpolation/approximation can be done using https://qwt.sourceforge.io/class_qwt...b757c87f8ac21d. But you can probably avoid doing it when using an algo, that does not overshoots that much and giving the plot some extra space at the borders: https://qwt.sourceforge.io/class_qwt...c60ab1597b1203
HTH,
Uwe
Re: QwtSplineCurveFitter and auto scale
Thank you. I switched to qwt 6.2 and the default spline both, "looks better" and has less (actually none at all) overshooting areas.