Hello,

I need to use spline interpolation for data display in my program. There is QwtSplineCurveFitter class - documentation says, thar it uses spline to fit curve, but the results are not acceptable (or I have missed something?):

Code to fit curve between 5 points:

Qt Code:
  1. QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
  2.  
  3. QPolygonF polygon;
  4.  
  5. polygon << QPointF(-1, -3);
  6. polygon << QPointF(1, 5);
  7. polygon << QPointF(2, 16);
  8. polygon << QPointF(3, 8);
  9. polygon << QPointF(4, 13);
  10.  
  11. fitter.setFitMode(fitter.ParametricSpline);
  12. curve1->setData(fitter.fitCurve(polygon));
  13. curve1->attach(ui->plot);
  14.  
  15. ui->plot->replot();
To copy to clipboard, switch view to plain text mode 

And this is the result:



Without using fitter class:



OS: Debian Sid
Qwt: 5.2.0-1 (libqwt5-qt4)

What's wrong there? Interpolation seems to be not working at all or spline resolution is very low but I can't see any method to increase it?